Skip to content
Fencer Vulns
low 3.3

CVE-2021-29510 json

Use of "infinity" as an input to datetime and date fields causes infinite loop in pydantic

published 2021-05-13 5 y ago modified 2026-07-08 4 mo ago also GHSA-5jqp-qgf6-3pvh , PYSEC-2021-47 , EUVD-2021-0206

cvss
3.3
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
1.0%
EPSS 1.0% chance of exploitation in 30 days, percentile 62%
public exploits
0
none known

Summary

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.

Patch / fix

  • pypi pydantic 1.6.2, 1.7.4, 1.8.2
  • pydantic pydantic 1.6.2, 1.7.4, 1.8.2
  • pydantic Debian 14, Debian 13, Debian 12 1.7.4-1

debian advisories DEBIAN-CVE-2021-29510

  • pydantic Ubuntu Pro 20.04 LTS 1.2-1ubuntu0.1~esm1

ubuntu advisories UBUNTU-CVE-2021-29510

Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

  • python-pydantic openSUSE Tumbleweed 2.13.4-2.1

opensuse advisories openSUSE-SU-2026:11424-1

  • python-pydantic Arch Linux 1.8.2-1

arch linux advisories AVG-1951

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2021-29510 updated cvss 7.5

python-pydantic: Use of "infinity" as an input to datetime and date fields causes infinite loop

  • Red Hat All currently supported Red Hat products
    not affected: vulnerable code not present

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

Exploit prediction

0.97% chance of exploitation in the next 30 days, higher than 62% of all scored CVEs (FIRST EPSS, 2026-11-08).

CVSS scores

assigned by version score vector
CNA 3.1 3.3 CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L
NVD 3.1 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NVD 2.0 5.0 AV:N/AC:L/Au:N/C:N/I:N/A:P
GitHub 3.1 3.3 CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L

Affected packages

ecosystem package affected fixed in
pypi pydantic
<1.6.2
>=1.8, <1.8.2
>=1.7, <1.7.4
1.6.2
1.8.2
1.7.4

Affected products

  • samuelcolvin pydantic

Classification

Weakness
  • CWE-835 Loop with Unreachable Exit Condition

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.