CVE-2021-29510Use of "infinity" as an input to datetime and date fields causes infinite loop in pydantic
- 3.3LowCVSS base score
- 0.97%Exploitation in 30 daysEPSS · top 37% of all CVEs
- NoKnown exploitednot in CISA's KEV catalog
- NonePublic exploitsnone known yet
Description
Pydantic 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.
Timeline
ID reserved
By GitHub_M
- 44 days later
· 44 days later
Published
- 3 years later
· 3 years later
Record updated
Changes after publication (a new score, a public exploit, EPSS crossing 1, 10 or 50 %, leaving KEV) are kept since November 2026; earlier ones are not known.
Scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| GitHub_MCNA (assigner) | 3.1 | Low3.3 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L |
| NVDNVD · Modified | 3.1 | High7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
- EPSS (exploitation in 30 days)
- 0.97% · top 37% of all CVEs (17 Nov 2026)
The list uses the assigner's score when there is one, then CISA's, then NVD's: Low 3.3.
Affected products
- affected >= 1.8.0, < 1.8.2
- affected >= 1.7.0, < 1.7.4
- affected < 1.6.2
Affected packages
From reviewed advisories of the GitHub Advisory Database.
- PyPIpydanticGHSA-5jqp-qgf6-3pvh (opens in a new tab)
References
References5
- https://github.com/samuelcolvin/pydantic/security/advisories/GHSA-5jqp-qgf6-3pvh (opens in a new tab)x_refsource_CONFIRMx_transferred
- https://github.com/samuelcolvin/pydantic/commit/7e83fdd2563ffac081db7ecdf1affa65ef38c468 (opens in a new tab)x_refsource_MISCx_transferred
- FEDORA-2021-f8bb3ba3ec (opens in a new tab)vendor-advisoryx_refsource_FEDORAx_transferred
- FEDORA-2021-4d3de3183f (opens in a new tab)vendor-advisoryx_refsource_FEDORAx_transferred
- FEDORA-2021-e7fabd81fb (opens in a new tab)vendor-advisoryx_refsource_FEDORAx_transferred
Sources
The same CVE in the primary databases and aggregators, to check against.
- CVE.org record (opens in a new tab)
- CVE List JSON (GitHub) (opens in a new tab)
- NVD (opens in a new tab)
- FIRST EPSS (opens in a new tab)
- EUVD EUVD-2021-0206 (opens in a new tab)
- OSV.dev (opens in a new tab)
- GitHub Advisory GHSA-5jqp-qgf6-3pvh (opens in a new tab)
- CIRCL Vulnerability-Lookup (opens in a new tab)
Badge for a README or a ticket
[](https://cveledger.app/cve/CVE-2021-29510)Record last updated .