cve.bz

CVE-2021-29510 Infinite Loop

7.5 highEPSS 1.0%Fix available

High (7.5). EPSS 1.0% estimated probability of exploitation activity in the next 30 days. Fixed in pydantic 1.6.2, 1.7.4, 1.8.2.

On this page
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.

Severity

CVSS 3.1

7.5 high
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
EPSS
1.0% (unchanged from 1.0% a week ago; 1.0% 30 days ago) estimated probability of exploitation activity in the next 30 days; 63rd percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWE
CWE-835 Loop with Unreachable Exit Condition (Infinite Loop)
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2021-29510 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-29510?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-29510?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2021-29510 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
pydantic:pydanticbefore 1.6.2
pydantic:pydanticfrom 1.7 before 1.7.4
pydantic:pydanticfrom 1.8 before 1.8.2
fedoraproject:fedora33
fedoraproject:fedora34

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-5jqp-qgf6-3pvhPyPIpydantic<1.6.21.6.2
GHSA-5jqp-qgf6-3pvhPyPIpydantic>=1.8 <1.8.21.8.2
GHSA-5jqp-qgf6-3pvhPyPIpydantic>=1.7 <1.7.41.7.4
PYSEC-2021-47PyPIpydantic<1.6.2
>=1.7 <1.7.4
>=1.8 <1.8.2
1.6.2, 1.7.4, 1.8.2

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12, 13, 14pydantic1.7.4-1DEBIAN-CVE-2021-29510
UbuntuPro:20.04:LTSpydantic1.2-1ubuntu0.1~esm1UBUNTU-CVE-2021-29510 USN-6553-1
openSUSETumbleweedpython-pydantic2.13.4-2.1openSUSE-SU-2026:11424-1

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; SUSE security data, CC BY 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · openSUSE.

References

Check your stackJSON