Home / samuelcolvin / pydantic / CVE-2021-29510
CVE-2021-29510: is it exploited, and which versions of samuelcolvin pydantic are affected and fixed?
CVE-2021-29510 is an infinite loop (denial of service) vulnerability in samuelcolvin pydantic. It is not known to be exploited: it is not in CISA's Known Exploited Vulnerabilities catalog (catalog 2026.11.30, read December 3, 2026, 17:09 UTC). Affected: pydantic before 1.6.2, pydantic from 1.8 before 1.8.2 and pydantic from 1.7 before 1.7.4 (GitHub advisory GHSA-5jqp-qgf6-3pvh). Fixed in 1.6.2, 1.8.2 and 1.7.4 (GitHub advisory GHSA-5jqp-qgf6-3pvh). Severity: Low (3.3, CVSS 3.1, from GitHub_M).
Data checked December 3, 2026: last read CISA KEV December 3, 2026, 17:09 UTC, CVE record November 19, 2026, 07:15 UTC and NVD November 19, 2026, 07:58 UTC.
What is CVE-2021-29510?
Use of "infinity" as an input to datetime and date fields causes infinite loop in pydantic
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.
From the CVE record by GitHub_M, last updated August 3, 2024, 22:11 UTC.
Which versions are affected, and which fix it?
| Vendor | Product | Affected | Fixed or not affected from |
|---|---|---|---|
| samuelcolvin | pydantic | >= 1.8.0, < 1.8.2 >= 1.7.0, < 1.7.4 < 1.6.2 |
As the CVE record by GitHub_M states it, last updated August 3, 2024. Version ranges are the CNA's; a version the record calls not affected is usually the fix.
Which packages are affected, and in which version is each fixed?
| Ecosystem | Package | Affected | Fixed in | Advisory |
|---|---|---|---|---|
| PyPI | pydantic | < 1.6.2 | 1.6.2 | GHSA-5jqp-qgf6-3pvh |
| PyPI | pydantic | >= 1.8, < 1.8.2 | 1.8.2 | GHSA-5jqp-qgf6-3pvh |
| PyPI | pydantic | >= 1.7, < 1.7.4 | 1.7.4 | GHSA-5jqp-qgf6-3pvh |
GitHub Advisory Database, reviewed advisories (CC BY 4.0); advisory updated June 9, 2026. Summary: Use of "infinity" as an input to datetime and date fields causes infinite loop in pydantic.
Which products and versions does the NVD list as affected?
| Vendor | Product | Versions | Type |
|---|---|---|---|
| pydantic | pydantic | before 1.6.2 | application |
| pydantic | pydantic | from 1.7 before 1.7.4 | application |
| pydantic | pydantic | from 1.8 before 1.8.2 | application |
| fedoraproject | fedora | 33 | operating system |
| fedoraproject | fedora | 34 | operating system |
NVD analysis (status Modified), last modified June 17, 2026, 03:47 UTC.
How severe is CVE-2021-29510?
| Score | Version | Vector | Source |
|---|---|---|---|
| Low 3.3 | CVSS 3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L | GitHub_M |
| High 7.5 | CVSS 3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NVD |
| Medium 5.0 | CVSS 2.0 | AV:N/AC:L/Au:N/C:N/I:N/A:P | NVD |
Each score is shown as its source gave it: the CNA that wrote the record, CISA's ADP (vulnrichment) and the NVD. They can differ.
What the ratings mean: in CVSS 3 and 4, scores run from 0 to 10, with Low 0.1 to 3.9, Medium 4.0 to 6.9, High 7.0 to 8.9 and Critical 9.0 to 10.0. CVSS 2 has no Critical band: its High runs from 7.0 to 10.0. The vector lists how the flaw is reached (network, local), what an attacker needs (privileges, a user's click) and what it can harm.
Is CVE-2021-29510 exploited in the wild?
- CISA KEV
- Not listed (catalog 2026.11.30)
- EPSS
- 0.97% probability of exploitation activity in the next 30 days, percentile 63.2 (FIRST EPSS, scores of December 3, 2026)
What kind of flaw is it?
- CWE-835 Loop with Unreachable Exit Condition
Where are the vendor advisories and references?
- https://github.com/samuelcolvin/pydantic/security/advisories/GHSA-5jqp-qgf6-3pvh x_refsource_CONFIRM
- https://github.com/samuelcolvin/pydantic/commit/7e83fdd2563ffac081db7ecdf1affa65ef38c468 x_refsource_MISC
- FEDORA-2021-f8bb3ba3ec vendor-advisory, x_refsource_FEDORA
- FEDORA-2021-4d3de3183f vendor-advisory, x_refsource_FEDORA
- FEDORA-2021-e7fabd81fb vendor-advisory, x_refsource_FEDORA
When was it published, and where is the official record?
- Reserved
- March 30, 2021
- Published
- May 13, 2021, 18:55 UTC
- CVE record updated
- August 3, 2024, 22:11 UTC by GitHub_M
- NVD
- Modified, last modified June 17, 2026, 03:47 UTC
- Last checked
- CVE list November 19, 2026, 07:15 UTC; NVD November 19, 2026, 07:58 UTC; KEV December 3, 2026, 17:09 UTC; EPSS December 3, 2026
- Official record
- cve.org · NVD
Questions about CVE-2021-29510
Is CVE-2021-29510 exploited in the wild?
Not as far as CISA knows: it is not in the Known Exploited Vulnerabilities catalog, read December 3, 2026, 17:09 UTC. FIRST's EPSS gives it a 0.97% chance of exploitation activity in the next 30 days (scores of December 3, 2026).
Which versions of samuelcolvin pydantic are affected by CVE-2021-29510?
pydantic before 1.6.2, pydantic from 1.8 before 1.8.2 and pydantic from 1.7 before 1.7.4, per the GitHub advisory GHSA-5jqp-qgf6-3pvh. The tables above give every range the sources list.
Which version fixes CVE-2021-29510?
1.6.2, 1.8.2 and 1.7.4, per the GitHub advisory GHSA-5jqp-qgf6-3pvh. Check the vendor's advisory before you rely on it.
How severe is CVE-2021-29510?
Low (3.3, CVSS 3.1, from GitHub_M). The severity table above shows each score with its source.
Where is the official record of CVE-2021-29510?
The CVE Program's record is at cve.org and the NVD's at nvd.nist.gov. For a fix, the vendor's own advisory is the one to follow.