Action not permitted
Modal body text goes here.
Modal Title
Modal Body
PYSEC-2021-47
Vulnerability from pysec - Published: 2021-05-13 19:15 - Updated: 2021-05-13 19:15Pydantic is a data validation and settings management using Python type hinting. In affected versions passing either 'infinity', 'inf' or float('inf') (or their negatives) to datetime or date fields causes validation to run forever with 100% CPU usage (on one CPU). Pydantic has been patched with fixes available in the following versions: v1.8.2, v1.7.4, v1.6.2. All these versions are available on pypi(https://pypi.org/project/pydantic/#history), and will be available on conda-forge(https://anaconda.org/conda-forge/pydantic) soon. See the changelog(https://pydantic-docs.helpmanual.io/) for details. If you absolutely can't upgrade, you can work around this risk using a validator(https://pydantic-docs.helpmanual.io/usage/validators/) to catch these values. This is not an ideal solution (in particular you'll need a slightly different function for datetimes), instead of a hack like this you should upgrade pydantic. If you are not using v1.8.x, v1.7.x or v1.6.x and are unable to upgrade to a fixed version of pydantic, please create an issue at https://github.com/samuelcolvin/pydantic/issues requesting a back-port, and we will endeavour to release a patch for earlier versions of pydantic.
| Name | purl | pydantic | pkg:pypi/pydantic |
|---|
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "pydantic",
"purl": "pkg:pypi/pydantic"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "7e83fdd2563ffac081db7ecdf1affa65ef38c468"
}
],
"repo": "https://github.com/samuelcolvin/pydantic",
"type": "GIT"
},
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.6.2"
},
{
"introduced": "1.7"
},
{
"fixed": "1.7.4"
},
{
"introduced": "1.8"
},
{
"fixed": "1.8.2"
}
],
"type": "ECOSYSTEM"
}
],
"versions": [
"0.0.1",
"0.0.2",
"0.0.3",
"0.0.4",
"0.0.5",
"0.0.6",
"0.0.7",
"0.0.8",
"0.1",
"0.2",
"0.2.1",
"0.3",
"0.4",
"0.5",
"0.6",
"0.6.1",
"0.6.2",
"0.6.3",
"0.6.4",
"0.7",
"0.7.1",
"0.8",
"0.9",
"0.9.1",
"0.10",
"0.11",
"0.11.1",
"0.11.2",
"0.12",
"0.12.1",
"0.13",
"0.13.1",
"0.14",
"0.15",
"0.16",
"0.16.1",
"0.17",
"0.18",
"0.18.1",
"0.18.2",
"0.19",
"0.20a1",
"0.20",
"0.20.1",
"0.21",
"0.22",
"0.23",
"0.24",
"0.25",
"0.26",
"0.27a1",
"0.27",
"0.28",
"0.29",
"0.30",
"0.30.1",
"0.31",
"0.31.1",
"0.32",
"0.32.1",
"0.32.2",
"1.0b1",
"1.0b2",
"1.0",
"1.1",
"1.1.1",
"1.2",
"1.3",
"1.4",
"1.5",
"1.5.1",
"1.6",
"1.6.1",
"1.7",
"1.7.1",
"1.7.2",
"1.7.3",
"1.8",
"1.8.1"
]
}
],
"aliases": [
"CVE-2021-29510",
"GHSA-5jqp-qgf6-3pvh"
],
"details": "Pydantic is a data validation and settings management using Python type hinting. In affected versions passing either `\u0027infinity\u0027`, `\u0027inf\u0027` or `float(\u0027inf\u0027)` (or their negatives) to `datetime` or `date` fields causes validation to run forever with 100% CPU usage (on one CPU). Pydantic has been patched with fixes available in the following versions: v1.8.2, v1.7.4, v1.6.2. All these versions are available on pypi(https://pypi.org/project/pydantic/#history), and will be available on conda-forge(https://anaconda.org/conda-forge/pydantic) soon. See the changelog(https://pydantic-docs.helpmanual.io/) for details. If you absolutely can\u0027t upgrade, you can work around this risk using a validator(https://pydantic-docs.helpmanual.io/usage/validators/) to catch these values. This is not an ideal solution (in particular you\u0027ll need a slightly different function for datetimes), instead of a hack like this you should upgrade pydantic. If you are not using v1.8.x, v1.7.x or v1.6.x and are unable to upgrade to a fixed version of pydantic, please create an issue at https://github.com/samuelcolvin/pydantic/issues requesting a back-port, and we will endeavour to release a patch for earlier versions of pydantic.",
"id": "PYSEC-2021-47",
"modified": "2021-05-13T19:15:00Z",
"published": "2021-05-13T19:15:00Z",
"references": [
{
"type": "ADVISORY",
"url": "https://github.com/samuelcolvin/pydantic/security/advisories/GHSA-5jqp-qgf6-3pvh"
},
{
"type": "FIX",
"url": "https://github.com/samuelcolvin/pydantic/commit/7e83fdd2563ffac081db7ecdf1affa65ef38c468"
}
]
}
BREW-AIDER-CVE-2021-29510 (GHSA-5JQP-QGF6-3PVH)
Vulnerability from osv_homebrew – Published: 2026-08-13 16:35 – Updated: 2026-09-09 23:40 – Source websiteImpact
Passing either 'infinity', 'inf' or float('inf') (or their negatives) to datetime or date fields causes validation to run forever with 100% CPU usage (on one CPU). Patches
Pydantic is be patched with fixes available in the following versions:
v1.8.2
v1.7.4
v1.6.2
All these versions are available on pypi, and will be available on conda-forge soon.
See the changelog for details. Workarounds
If you absolutely can't upgrade, you can work around this risk using a validator to catch these values, brief demo:
from datetime import date from pydantic import BaseModel, validator
class DemoModel(BaseModel): date_of_birth: date
@validator('date_of_birth', pre=True)
def skip_infinite_values(cls, v):
try:
seconds = float(v)
except (ValueError, TypeError):
return v
else:
if seconds == float('inf'):
return date.max
elif seconds == float('-inf'):
return date.min
else:
return seconds
Note: this is not an ideal solution (in particular you'll need a slightly different function for datetimes), instead of a hack like this you should upgrade pydantic.
If you are not using v1.8.x, v1.7.x or v1.6.x and are unable to upgrade to a fixed version of pydantic, please create an issue requesting a back-port, and we will endeavour to release a patch for earlier versions of pydantic. References
This was fixed in commit 7e83fdd.
{
"affected": [
{
"ecosystem_specific": {
"fix": "bump",
"range_state": "fixed",
"resource": "pydantic",
"resource_purl": "pkg:pypi/pydantic@2.12.5",
"upstream_fixed_in": "1.8.2"
},
"package": {
"ecosystem": "Homebrew",
"name": "aider",
"purl": "pkg:brew/aider"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.86.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"database_specific": {
"confidence": "high",
"source": "matched",
"strategy": "registry",
"upstream_evidence": [
{
"ecosystem": "PyPI",
"key": "pkg:pypi/pydantic@2.12.5",
"name": "pydantic",
"resource": "pydantic",
"strategy": "registry",
"subject_version": "2.12.5"
}
]
},
"details": "Impact\n\nPassing either \u0027infinity\u0027, \u0027inf\u0027 or float(\u0027inf\u0027) (or their negatives) to datetime or date fields causes validation to run forever with 100% CPU usage (on one CPU).\nPatches\n\nPydantic is be patched with fixes available in the following versions:\n\n v1.8.2\n v1.7.4\n v1.6.2\n\nAll these versions are available on pypi, and will be available on conda-forge soon.\n\nSee the changelog for details.\nWorkarounds\n\nIf you absolutely can\u0027t upgrade, you can work around this risk using a validator to catch these values, brief demo:\n\nfrom datetime import date\nfrom pydantic import BaseModel, validator\n\nclass DemoModel(BaseModel):\n date_of_birth: date\n\n @validator(\u0027date_of_birth\u0027, pre=True)\n def skip_infinite_values(cls, v):\n try:\n seconds = float(v)\n except (ValueError, TypeError):\n return v\n else:\n if seconds == float(\u0027inf\u0027):\n return date.max\n elif seconds == float(\u0027-inf\u0027):\n return date.min\n else:\n return seconds\n\nNote: this is not an ideal solution (in particular you\u0027ll need a slightly different function for datetimes), instead of a hack like this you should upgrade pydantic.\n\nIf you are not using v1.8.x, v1.7.x or v1.6.x and are unable to upgrade to a fixed version of pydantic, please create an issue requesting a back-port, and we will endeavour to release a patch for earlier versions of pydantic.\nReferences\n\nThis was fixed in commit 7e83fdd.",
"id": "BREW-aider-CVE-2021-29510",
"modified": "2026-09-09T23:40:56Z",
"published": "2026-08-13T16:35:12Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/samuelcolvin/pydantic/security/advisories/GHSA-5jqp-qgf6-3pvh"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-29510"
},
{
"type": "WEB",
"url": "https://github.com/pydantic/pydantic/commit/1c24f1d74ba95ea985b50bdc001ce96c813229aa"
},
{
"type": "WEB",
"url": "https://github.com/pydantic/pydantic/commit/80e0dd3f752bef145dce12f160d262bb40ec8d47"
},
{
"type": "WEB",
"url": "https://github.com/pydantic/pydantic/commit/bdde15b7b947c94ca00fd6eb92da8db390a13520"
},
{
"type": "WEB",
"url": "https://github.com/samuelcolvin/pydantic/commit/7e83fdd2563ffac081db7ecdf1affa65ef38c468"
},
{
"type": "PACKAGE",
"url": "https://github.com/pydantic/pydantic"
},
{
"type": "WEB",
"url": "https://github.com/pypa/advisory-database/tree/main/vulns/pydantic/PYSEC-2021-47.yaml"
},
{
"type": "WEB",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/S2HT266L6Q7H6ICP7DFGXOGBJHNNKMKB"
},
{
"type": "WEB",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UEFWM7DYKD2ZHE7R5YT5EQWJPV4ZKYRB"
},
{
"type": "WEB",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UMKAJX4O6IGBBCE32CO2G7PZQCCQSBLV"
}
],
"schema_version": "1.7.3",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "Use of \"infinity\" as an input to datetime and date fields causes infinite loop in pydantic",
"upstream": [
"GHSA-5jqp-qgf6-3pvh",
"CVE-2021-29510",
"PYSEC-2021-47"
]
}
BREW-MENTAT-CVE-2021-29510 (GHSA-5JQP-QGF6-3PVH)
Vulnerability from osv_homebrew – Published: 2026-08-13 17:13 – Updated: 2026-09-10 00:30 – Source websiteImpact
Passing either 'infinity', 'inf' or float('inf') (or their negatives) to datetime or date fields causes validation to run forever with 100% CPU usage (on one CPU). Patches
Pydantic is be patched with fixes available in the following versions:
v1.8.2
v1.7.4
v1.6.2
All these versions are available on pypi, and will be available on conda-forge soon.
See the changelog for details. Workarounds
If you absolutely can't upgrade, you can work around this risk using a validator to catch these values, brief demo:
from datetime import date from pydantic import BaseModel, validator
class DemoModel(BaseModel): date_of_birth: date
@validator('date_of_birth', pre=True)
def skip_infinite_values(cls, v):
try:
seconds = float(v)
except (ValueError, TypeError):
return v
else:
if seconds == float('inf'):
return date.max
elif seconds == float('-inf'):
return date.min
else:
return seconds
Note: this is not an ideal solution (in particular you'll need a slightly different function for datetimes), instead of a hack like this you should upgrade pydantic.
If you are not using v1.8.x, v1.7.x or v1.6.x and are unable to upgrade to a fixed version of pydantic, please create an issue requesting a back-port, and we will endeavour to release a patch for earlier versions of pydantic. References
This was fixed in commit 7e83fdd.
| URL | Type | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|||||||||||||||||||||||||||||||||||
{
"affected": [
{
"ecosystem_specific": {
"fix": "bump",
"range_state": "fixed",
"resource": "pydantic",
"resource_purl": "pkg:pypi/pydantic@2.12.0",
"upstream_fixed_in": "1.8.2"
},
"package": {
"ecosystem": "Homebrew",
"name": "mentat",
"purl": "pkg:brew/mentat"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.0.8_4"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"database_specific": {
"confidence": "high",
"source": "matched",
"strategy": "registry",
"upstream_evidence": [
{
"ecosystem": "PyPI",
"key": "pkg:pypi/pydantic@2.12.0",
"name": "pydantic",
"resource": "pydantic",
"strategy": "registry",
"subject_version": "2.12.0"
}
]
},
"details": "Impact\n\nPassing either \u0027infinity\u0027, \u0027inf\u0027 or float(\u0027inf\u0027) (or their negatives) to datetime or date fields causes validation to run forever with 100% CPU usage (on one CPU).\nPatches\n\nPydantic is be patched with fixes available in the following versions:\n\n v1.8.2\n v1.7.4\n v1.6.2\n\nAll these versions are available on pypi, and will be available on conda-forge soon.\n\nSee the changelog for details.\nWorkarounds\n\nIf you absolutely can\u0027t upgrade, you can work around this risk using a validator to catch these values, brief demo:\n\nfrom datetime import date\nfrom pydantic import BaseModel, validator\n\nclass DemoModel(BaseModel):\n date_of_birth: date\n\n @validator(\u0027date_of_birth\u0027, pre=True)\n def skip_infinite_values(cls, v):\n try:\n seconds = float(v)\n except (ValueError, TypeError):\n return v\n else:\n if seconds == float(\u0027inf\u0027):\n return date.max\n elif seconds == float(\u0027-inf\u0027):\n return date.min\n else:\n return seconds\n\nNote: this is not an ideal solution (in particular you\u0027ll need a slightly different function for datetimes), instead of a hack like this you should upgrade pydantic.\n\nIf you are not using v1.8.x, v1.7.x or v1.6.x and are unable to upgrade to a fixed version of pydantic, please create an issue requesting a back-port, and we will endeavour to release a patch for earlier versions of pydantic.\nReferences\n\nThis was fixed in commit 7e83fdd.",
"id": "BREW-mentat-CVE-2021-29510",
"modified": "2026-09-10T00:30:28Z",
"published": "2026-08-13T17:13:16Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/samuelcolvin/pydantic/security/advisories/GHSA-5jqp-qgf6-3pvh"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-29510"
},
{
"type": "WEB",
"url": "https://github.com/pydantic/pydantic/commit/1c24f1d74ba95ea985b50bdc001ce96c813229aa"
},
{
"type": "WEB",
"url": "https://github.com/pydantic/pydantic/commit/80e0dd3f752bef145dce12f160d262bb40ec8d47"
},
{
"type": "WEB",
"url": "https://github.com/pydantic/pydantic/commit/bdde15b7b947c94ca00fd6eb92da8db390a13520"
},
{
"type": "WEB",
"url": "https://github.com/samuelcolvin/pydantic/commit/7e83fdd2563ffac081db7ecdf1affa65ef38c468"
},
{
"type": "PACKAGE",
"url": "https://github.com/pydantic/pydantic"
},
{
"type": "WEB",
"url": "https://github.com/pypa/advisory-database/tree/main/vulns/pydantic/PYSEC-2021-47.yaml"
},
{
"type": "WEB",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/S2HT266L6Q7H6ICP7DFGXOGBJHNNKMKB"
},
{
"type": "WEB",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UEFWM7DYKD2ZHE7R5YT5EQWJPV4ZKYRB"
},
{
"type": "WEB",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UMKAJX4O6IGBBCE32CO2G7PZQCCQSBLV"
}
],
"schema_version": "1.7.3",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "Use of \"infinity\" as an input to datetime and date fields causes infinite loop in pydantic",
"upstream": [
"GHSA-5jqp-qgf6-3pvh",
"CVE-2021-29510",
"PYSEC-2021-47"
]
}
BREW-PYDANTIC-CVE-2021-29510 (GHSA-5JQP-QGF6-3PVH)
Vulnerability from osv_homebrew – Published: 2026-08-13 17:29 – Updated: 2026-09-10 00:59 – Source websiteImpact
Passing either 'infinity', 'inf' or float('inf') (or their negatives) to datetime or date fields causes validation to run forever with 100% CPU usage (on one CPU). Patches
Pydantic is be patched with fixes available in the following versions:
v1.8.2
v1.7.4
v1.6.2
All these versions are available on pypi, and will be available on conda-forge soon.
See the changelog for details. Workarounds
If you absolutely can't upgrade, you can work around this risk using a validator to catch these values, brief demo:
from datetime import date from pydantic import BaseModel, validator
class DemoModel(BaseModel): date_of_birth: date
@validator('date_of_birth', pre=True)
def skip_infinite_values(cls, v):
try:
seconds = float(v)
except (ValueError, TypeError):
return v
else:
if seconds == float('inf'):
return date.max
elif seconds == float('-inf'):
return date.min
else:
return seconds
Note: this is not an ideal solution (in particular you'll need a slightly different function for datetimes), instead of a hack like this you should upgrade pydantic.
If you are not using v1.8.x, v1.7.x or v1.6.x and are unable to upgrade to a fixed version of pydantic, please create an issue requesting a back-port, and we will endeavour to release a patch for earlier versions of pydantic. References
This was fixed in commit 7e83fdd.
| URL | Type | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|||||||||||||||||||||||||||||||||||
{
"affected": [
{
"ecosystem_specific": {
"fix": "bump",
"range_state": "fixed",
"upstream_fixed_in": "1.8.2"
},
"package": {
"ecosystem": "Homebrew",
"name": "pydantic",
"purl": "pkg:brew/pydantic"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2.13.4"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"database_specific": {
"confidence": "high",
"source": "matched",
"strategy": "registry",
"upstream_evidence": [
{
"ecosystem": "PyPI",
"key": "pkg:pypi/pydantic@2.13.5",
"name": "pydantic",
"strategy": "registry",
"subject_version": "2.13.5"
},
{
"ecosystem": "Debian",
"key": "Debian/pydantic",
"name": "pydantic",
"strategy": "distro"
},
{
"ecosystem": "PyPI",
"key": "upstream:pkg:pypi/pydantic@2.13.5",
"name": "pydantic",
"strategy": "distro",
"subject_version": "2.13.5"
},
{
"ecosystem": "Ubuntu",
"key": "Ubuntu/pydantic",
"name": "pydantic",
"strategy": "distro"
}
]
},
"details": "Impact\n\nPassing either \u0027infinity\u0027, \u0027inf\u0027 or float(\u0027inf\u0027) (or their negatives) to datetime or date fields causes validation to run forever with 100% CPU usage (on one CPU).\nPatches\n\nPydantic is be patched with fixes available in the following versions:\n\n v1.8.2\n v1.7.4\n v1.6.2\n\nAll these versions are available on pypi, and will be available on conda-forge soon.\n\nSee the changelog for details.\nWorkarounds\n\nIf you absolutely can\u0027t upgrade, you can work around this risk using a validator to catch these values, brief demo:\n\nfrom datetime import date\nfrom pydantic import BaseModel, validator\n\nclass DemoModel(BaseModel):\n date_of_birth: date\n\n @validator(\u0027date_of_birth\u0027, pre=True)\n def skip_infinite_values(cls, v):\n try:\n seconds = float(v)\n except (ValueError, TypeError):\n return v\n else:\n if seconds == float(\u0027inf\u0027):\n return date.max\n elif seconds == float(\u0027-inf\u0027):\n return date.min\n else:\n return seconds\n\nNote: this is not an ideal solution (in particular you\u0027ll need a slightly different function for datetimes), instead of a hack like this you should upgrade pydantic.\n\nIf you are not using v1.8.x, v1.7.x or v1.6.x and are unable to upgrade to a fixed version of pydantic, please create an issue requesting a back-port, and we will endeavour to release a patch for earlier versions of pydantic.\nReferences\n\nThis was fixed in commit 7e83fdd.",
"id": "BREW-pydantic-CVE-2021-29510",
"modified": "2026-09-10T00:59:04Z",
"published": "2026-08-13T17:29:36Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/samuelcolvin/pydantic/security/advisories/GHSA-5jqp-qgf6-3pvh"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-29510"
},
{
"type": "WEB",
"url": "https://github.com/pydantic/pydantic/commit/1c24f1d74ba95ea985b50bdc001ce96c813229aa"
},
{
"type": "WEB",
"url": "https://github.com/pydantic/pydantic/commit/80e0dd3f752bef145dce12f160d262bb40ec8d47"
},
{
"type": "WEB",
"url": "https://github.com/pydantic/pydantic/commit/bdde15b7b947c94ca00fd6eb92da8db390a13520"
},
{
"type": "WEB",
"url": "https://github.com/samuelcolvin/pydantic/commit/7e83fdd2563ffac081db7ecdf1affa65ef38c468"
},
{
"type": "PACKAGE",
"url": "https://github.com/pydantic/pydantic"
},
{
"type": "WEB",
"url": "https://github.com/pypa/advisory-database/tree/main/vulns/pydantic/PYSEC-2021-47.yaml"
},
{
"type": "WEB",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/S2HT266L6Q7H6ICP7DFGXOGBJHNNKMKB"
},
{
"type": "WEB",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UEFWM7DYKD2ZHE7R5YT5EQWJPV4ZKYRB"
},
{
"type": "WEB",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UMKAJX4O6IGBBCE32CO2G7PZQCCQSBLV"
}
],
"schema_version": "1.7.3",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "Use of \"infinity\" as an input to datetime and date fields causes infinite loop in pydantic",
"upstream": [
"GHSA-5jqp-qgf6-3pvh",
"CVE-2021-29510",
"PYSEC-2021-47"
]
}
CVE-2021-29510 (GCVE-0-2021-29510)
Vulnerability from cvelistv5 – Published: 2021-05-13 18:55 – Updated: 2024-08-03 22:11- CWE-835 - Loop with Unreachable Exit Condition ('Infinite Loop')
| URL | Tags |
|---|---|
| https://github.com/samuelcolvin/pydantic/security… | x_refsource_CONFIRM |
| https://github.com/samuelcolvin/pydantic/commit/7… | x_refsource_MISC |
| https://lists.fedoraproject.org/archives/list/pac… | vendor-advisoryx_refsource_FEDORA |
| https://lists.fedoraproject.org/archives/list/pac… | vendor-advisoryx_refsource_FEDORA |
| https://lists.fedoraproject.org/archives/list/pac… | vendor-advisoryx_refsource_FEDORA |
| Vendor | Product | Version | |
|---|---|---|---|
| samuelcolvin | pydantic |
Affected:
>= 1.8.0, < 1.8.2
Affected: >= 1.7.0, < 1.7.4 Affected: < 1.6.2 |
{
"containers": {
"adp": [
{
"providerMetadata": {
"dateUpdated": "2024-08-03T22:11:05.442Z",
"orgId": "af854a3a-2127-422b-91ae-364da2661108",
"shortName": "CVE"
},
"references": [
{
"tags": [
"x_refsource_CONFIRM",
"x_transferred"
],
"url": "https://github.com/samuelcolvin/pydantic/security/advisories/GHSA-5jqp-qgf6-3pvh"
},
{
"tags": [
"x_refsource_MISC",
"x_transferred"
],
"url": "https://github.com/samuelcolvin/pydantic/commit/7e83fdd2563ffac081db7ecdf1affa65ef38c468"
},
{
"name": "FEDORA-2021-f8bb3ba3ec",
"tags": [
"vendor-advisory",
"x_refsource_FEDORA",
"x_transferred"
],
"url": "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/UMKAJX4O6IGBBCE32CO2G7PZQCCQSBLV/"
},
{
"name": "FEDORA-2021-4d3de3183f",
"tags": [
"vendor-advisory",
"x_refsource_FEDORA",
"x_transferred"
],
"url": "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/S2HT266L6Q7H6ICP7DFGXOGBJHNNKMKB/"
},
{
"name": "FEDORA-2021-e7fabd81fb",
"tags": [
"vendor-advisory",
"x_refsource_FEDORA",
"x_transferred"
],
"url": "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/UEFWM7DYKD2ZHE7R5YT5EQWJPV4ZKYRB/"
}
],
"title": "CVE Program Container"
}
],
"cna": {
"affected": [
{
"product": "pydantic",
"vendor": "samuelcolvin",
"versions": [
{
"status": "affected",
"version": "\u003e= 1.8.0, \u003c 1.8.2"
},
{
"status": "affected",
"version": "\u003e= 1.7.0, \u003c 1.7.4"
},
{
"status": "affected",
"version": "\u003c 1.6.2"
}
]
}
],
"descriptions": [
{
"lang": "en",
"value": "Pydantic is a data validation and settings management using Python type hinting. In affected versions passing either `\u0027infinity\u0027`, `\u0027inf\u0027` or `float(\u0027inf\u0027)` (or their negatives) to `datetime` or `date` fields causes validation to run forever with 100% CPU usage (on one CPU). Pydantic has been patched with fixes available in the following versions: v1.8.2, v1.7.4, v1.6.2. All these versions are available on pypi(https://pypi.org/project/pydantic/#history), and will be available on conda-forge(https://anaconda.org/conda-forge/pydantic) soon. See the changelog(https://pydantic-docs.helpmanual.io/) for details. If you absolutely can\u0027t upgrade, you can work around this risk using a validator(https://pydantic-docs.helpmanual.io/usage/validators/) to catch these values. This is not an ideal solution (in particular you\u0027ll need a slightly different function for datetimes), instead of a hack like this you should upgrade pydantic. If you are not using v1.8.x, v1.7.x or v1.6.x and are unable to upgrade to a fixed version of pydantic, please create an issue at https://github.com/samuelcolvin/pydantic/issues requesting a back-port, and we will endeavour to release a patch for earlier versions of pydantic."
}
],
"metrics": [
{
"cvssV3_1": {
"attackComplexity": "LOW",
"attackVector": "LOCAL",
"availabilityImpact": "LOW",
"baseScore": 3.3,
"baseSeverity": "LOW",
"confidentialityImpact": "NONE",
"integrityImpact": "NONE",
"privilegesRequired": "NONE",
"scope": "UNCHANGED",
"userInteraction": "REQUIRED",
"vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L",
"version": "3.1"
}
}
],
"problemTypes": [
{
"descriptions": [
{
"cweId": "CWE-835",
"description": "CWE-835: Loop with Unreachable Exit Condition (\u0027Infinite Loop\u0027)",
"lang": "en",
"type": "CWE"
}
]
}
],
"providerMetadata": {
"dateUpdated": "2021-05-23T02:06:14.000Z",
"orgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
"shortName": "GitHub_M"
},
"references": [
{
"tags": [
"x_refsource_CONFIRM"
],
"url": "https://github.com/samuelcolvin/pydantic/security/advisories/GHSA-5jqp-qgf6-3pvh"
},
{
"tags": [
"x_refsource_MISC"
],
"url": "https://github.com/samuelcolvin/pydantic/commit/7e83fdd2563ffac081db7ecdf1affa65ef38c468"
},
{
"name": "FEDORA-2021-f8bb3ba3ec",
"tags": [
"vendor-advisory",
"x_refsource_FEDORA"
],
"url": "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/UMKAJX4O6IGBBCE32CO2G7PZQCCQSBLV/"
},
{
"name": "FEDORA-2021-4d3de3183f",
"tags": [
"vendor-advisory",
"x_refsource_FEDORA"
],
"url": "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/S2HT266L6Q7H6ICP7DFGXOGBJHNNKMKB/"
},
{
"name": "FEDORA-2021-e7fabd81fb",
"tags": [
"vendor-advisory",
"x_refsource_FEDORA"
],
"url": "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/UEFWM7DYKD2ZHE7R5YT5EQWJPV4ZKYRB/"
}
],
"source": {
"advisory": "GHSA-5jqp-qgf6-3pvh",
"discovery": "UNKNOWN"
},
"title": "Use of \"infinity\" as an input to datetime and date fields causes infinite loop in pydantic",
"x_legacyV4Record": {
"CVE_data_meta": {
"ASSIGNER": "security-advisories@github.com",
"ID": "CVE-2021-29510",
"STATE": "PUBLIC",
"TITLE": "Use of \"infinity\" as an input to datetime and date fields causes infinite loop in pydantic"
},
"affects": {
"vendor": {
"vendor_data": [
{
"product": {
"product_data": [
{
"product_name": "pydantic",
"version": {
"version_data": [
{
"version_value": "\u003e= 1.8.0, \u003c 1.8.2"
},
{
"version_value": "\u003e= 1.7.0, \u003c 1.7.4"
},
{
"version_value": "\u003c 1.6.2"
}
]
}
}
]
},
"vendor_name": "samuelcolvin"
}
]
}
},
"data_format": "MITRE",
"data_type": "CVE",
"data_version": "4.0",
"description": {
"description_data": [
{
"lang": "eng",
"value": "Pydantic is a data validation and settings management using Python type hinting. In affected versions passing either `\u0027infinity\u0027`, `\u0027inf\u0027` or `float(\u0027inf\u0027)` (or their negatives) to `datetime` or `date` fields causes validation to run forever with 100% CPU usage (on one CPU). Pydantic has been patched with fixes available in the following versions: v1.8.2, v1.7.4, v1.6.2. All these versions are available on pypi(https://pypi.org/project/pydantic/#history), and will be available on conda-forge(https://anaconda.org/conda-forge/pydantic) soon. See the changelog(https://pydantic-docs.helpmanual.io/) for details. If you absolutely can\u0027t upgrade, you can work around this risk using a validator(https://pydantic-docs.helpmanual.io/usage/validators/) to catch these values. This is not an ideal solution (in particular you\u0027ll need a slightly different function for datetimes), instead of a hack like this you should upgrade pydantic. If you are not using v1.8.x, v1.7.x or v1.6.x and are unable to upgrade to a fixed version of pydantic, please create an issue at https://github.com/samuelcolvin/pydantic/issues requesting a back-port, and we will endeavour to release a patch for earlier versions of pydantic."
}
]
},
"impact": {
"cvss": {
"attackComplexity": "LOW",
"attackVector": "LOCAL",
"availabilityImpact": "LOW",
"baseScore": 3.3,
"baseSeverity": "LOW",
"confidentialityImpact": "NONE",
"integrityImpact": "NONE",
"privilegesRequired": "NONE",
"scope": "UNCHANGED",
"userInteraction": "REQUIRED",
"vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L",
"version": "3.1"
}
},
"problemtype": {
"problemtype_data": [
{
"description": [
{
"lang": "eng",
"value": "CWE-835: Loop with Unreachable Exit Condition (\u0027Infinite Loop\u0027)"
}
]
}
]
},
"references": {
"reference_data": [
{
"name": "https://github.com/samuelcolvin/pydantic/security/advisories/GHSA-5jqp-qgf6-3pvh",
"refsource": "CONFIRM",
"url": "https://github.com/samuelcolvin/pydantic/security/advisories/GHSA-5jqp-qgf6-3pvh"
},
{
"name": "https://github.com/samuelcolvin/pydantic/commit/7e83fdd2563ffac081db7ecdf1affa65ef38c468",
"refsource": "MISC",
"url": "https://github.com/samuelcolvin/pydantic/commit/7e83fdd2563ffac081db7ecdf1affa65ef38c468"
},
{
"name": "FEDORA-2021-f8bb3ba3ec",
"refsource": "FEDORA",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UMKAJX4O6IGBBCE32CO2G7PZQCCQSBLV/"
},
{
"name": "FEDORA-2021-4d3de3183f",
"refsource": "FEDORA",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/S2HT266L6Q7H6ICP7DFGXOGBJHNNKMKB/"
},
{
"name": "FEDORA-2021-e7fabd81fb",
"refsource": "FEDORA",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UEFWM7DYKD2ZHE7R5YT5EQWJPV4ZKYRB/"
}
]
},
"source": {
"advisory": "GHSA-5jqp-qgf6-3pvh",
"discovery": "UNKNOWN"
}
}
}
},
"cveMetadata": {
"assignerOrgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
"assignerShortName": "GitHub_M",
"cveId": "CVE-2021-29510",
"datePublished": "2021-05-13T18:55:11.000Z",
"dateReserved": "2021-03-30T00:00:00.000Z",
"dateUpdated": "2024-08-03T22:11:05.442Z",
"state": "PUBLISHED"
},
"dataType": "CVE_RECORD",
"dataVersion": "5.1"
}
GHSA-5JQP-QGF6-3PVH
Vulnerability from github – Published: 2021-05-13 20:23 – Updated: 2026-06-09 13:01Impact
Passing either 'infinity', 'inf' or float('inf') (or their negatives) to datetime or date fields causes validation to run forever with 100% CPU usage (on one CPU). Patches
Pydantic is be patched with fixes available in the following versions:
v1.8.2
v1.7.4
v1.6.2
All these versions are available on pypi, and will be available on conda-forge soon.
See the changelog for details. Workarounds
If you absolutely can't upgrade, you can work around this risk using a validator to catch these values, brief demo:
from datetime import date from pydantic import BaseModel, validator
class DemoModel(BaseModel): date_of_birth: date
@validator('date_of_birth', pre=True)
def skip_infinite_values(cls, v):
try:
seconds = float(v)
except (ValueError, TypeError):
return v
else:
if seconds == float('inf'):
return date.max
elif seconds == float('-inf'):
return date.min
else:
return seconds
Note: this is not an ideal solution (in particular you'll need a slightly different function for datetimes), instead of a hack like this you should upgrade pydantic.
If you are not using v1.8.x, v1.7.x or v1.6.x and are unable to upgrade to a fixed version of pydantic, please create an issue requesting a back-port, and we will endeavour to release a patch for earlier versions of pydantic. References
This was fixed in commit 7e83fdd.
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "pydantic"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.6.2"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "PyPI",
"name": "pydantic"
},
"ranges": [
{
"events": [
{
"introduced": "1.8"
},
{
"fixed": "1.8.2"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "PyPI",
"name": "pydantic"
},
"ranges": [
{
"events": [
{
"introduced": "1.7"
},
{
"fixed": "1.7.4"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2021-29510"
],
"database_specific": {
"cwe_ids": [
"CWE-835"
],
"github_reviewed": true,
"github_reviewed_at": "2021-05-13T18:54:35Z",
"nvd_published_at": "2021-05-13T19:15:00Z",
"severity": "MODERATE"
},
"details": "Impact\n\nPassing either \u0027infinity\u0027, \u0027inf\u0027 or float(\u0027inf\u0027) (or their negatives) to datetime or date fields causes validation to run forever with 100% CPU usage (on one CPU).\nPatches\n\nPydantic is be patched with fixes available in the following versions:\n\n v1.8.2\n v1.7.4\n v1.6.2\n\nAll these versions are available on pypi, and will be available on conda-forge soon.\n\nSee the changelog for details.\nWorkarounds\n\nIf you absolutely can\u0027t upgrade, you can work around this risk using a validator to catch these values, brief demo:\n\nfrom datetime import date\nfrom pydantic import BaseModel, validator\n\nclass DemoModel(BaseModel):\n date_of_birth: date\n\n @validator(\u0027date_of_birth\u0027, pre=True)\n def skip_infinite_values(cls, v):\n try:\n seconds = float(v)\n except (ValueError, TypeError):\n return v\n else:\n if seconds == float(\u0027inf\u0027):\n return date.max\n elif seconds == float(\u0027-inf\u0027):\n return date.min\n else:\n return seconds\n\nNote: this is not an ideal solution (in particular you\u0027ll need a slightly different function for datetimes), instead of a hack like this you should upgrade pydantic.\n\nIf you are not using v1.8.x, v1.7.x or v1.6.x and are unable to upgrade to a fixed version of pydantic, please create an issue requesting a back-port, and we will endeavour to release a patch for earlier versions of pydantic.\nReferences\n\nThis was fixed in commit 7e83fdd.",
"id": "GHSA-5jqp-qgf6-3pvh",
"modified": "2026-06-09T13:01:00Z",
"published": "2021-05-13T20:23:17Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/samuelcolvin/pydantic/security/advisories/GHSA-5jqp-qgf6-3pvh"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-29510"
},
{
"type": "WEB",
"url": "https://github.com/pydantic/pydantic/commit/1c24f1d74ba95ea985b50bdc001ce96c813229aa"
},
{
"type": "WEB",
"url": "https://github.com/pydantic/pydantic/commit/80e0dd3f752bef145dce12f160d262bb40ec8d47"
},
{
"type": "WEB",
"url": "https://github.com/pydantic/pydantic/commit/bdde15b7b947c94ca00fd6eb92da8db390a13520"
},
{
"type": "WEB",
"url": "https://github.com/samuelcolvin/pydantic/commit/7e83fdd2563ffac081db7ecdf1affa65ef38c468"
},
{
"type": "PACKAGE",
"url": "https://github.com/pydantic/pydantic"
},
{
"type": "WEB",
"url": "https://github.com/pypa/advisory-database/tree/main/vulns/pydantic/PYSEC-2021-47.yaml"
},
{
"type": "WEB",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/S2HT266L6Q7H6ICP7DFGXOGBJHNNKMKB"
},
{
"type": "WEB",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UEFWM7DYKD2ZHE7R5YT5EQWJPV4ZKYRB"
},
{
"type": "WEB",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UMKAJX4O6IGBBCE32CO2G7PZQCCQSBLV"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "Use of \"infinity\" as an input to datetime and date fields causes infinite loop in pydantic"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.