CVE-2021-29510
published low CVSS 3.1 · 3.3Use of "infinity" as an input to datetime and date fields causes infinite loop in pydantic
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| samuelcolvin | — | pydantic>= 1.8.0, < 1.8.2 · >= 1.7.0, < 1.7.4 · < 1.6.2 | Affected | Not stated | GitHub_M |
| Ubuntu | focal | pydantic | Advisory build | 1.2-1ubuntu0.1~esm1 | USN-6553-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python310-pydanticaarch64 | Advisory build | 2.6.4-2.1 | OPENSUSE-SU-2024:13869-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python310-pydanticppc64le | Advisory build | 2.6.4-2.1 | OPENSUSE-SU-2024:13869-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python310-pydantics390x | Advisory build | 2.6.4-2.1 | OPENSUSE-SU-2024:13869-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python310-pydanticx86_64 | Advisory build | 2.6.4-2.1 | OPENSUSE-SU-2024:13869-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-pydanticaarch64 | Advisory build | 2.6.4-2.1 | OPENSUSE-SU-2024:13869-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-pydanticppc64le | Advisory build | 2.6.4-2.1 | OPENSUSE-SU-2024:13869-1 |
Show 27 more entries
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-pydantics390x | Advisory build | 2.6.4-2.1 | OPENSUSE-SU-2024:13869-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-pydanticx86_64 | Advisory build | 2.6.4-2.1 | OPENSUSE-SU-2024:13869-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python312-pydanticaarch64 | Advisory build | 2.6.4-2.1 | OPENSUSE-SU-2024:13869-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python312-pydanticppc64le | Advisory build | 2.6.4-2.1 | OPENSUSE-SU-2024:13869-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python312-pydantics390x | Advisory build | 2.6.4-2.1 | OPENSUSE-SU-2024:13869-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python312-pydanticx86_64 | Advisory build | 2.6.4-2.1 | OPENSUSE-SU-2024:13869-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-pydanticaarch64 | Advisory build | 2.13.4-2.1 | OPENSUSE-SU-2026:11424-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-pydanticppc64le | Advisory build | 2.13.4-2.1 | OPENSUSE-SU-2026:11424-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-pydantics390x | Advisory build | 2.13.4-2.1 | OPENSUSE-SU-2026:11424-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-pydanticx86_64 | Advisory build | 2.13.4-2.1 | OPENSUSE-SU-2026:11424-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-pydanticaarch64 | Advisory build | 2.13.4-2.1 | OPENSUSE-SU-2026:11424-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-pydanticppc64le | Advisory build | 2.13.4-2.1 | OPENSUSE-SU-2026:11424-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-pydantics390x | Advisory build | 2.13.4-2.1 | OPENSUSE-SU-2026:11424-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-pydanticx86_64 | Advisory build | 2.13.4-2.1 | OPENSUSE-SU-2026:11424-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python36-pydanticaarch64 | Advisory build | 1.8.2-1.2 | OPENSUSE-SU-2024:11254-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python36-pydanticppc64le | Advisory build | 1.8.2-1.2 | OPENSUSE-SU-2024:11254-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python36-pydantics390x | Advisory build | 1.8.2-1.2 | OPENSUSE-SU-2024:11254-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python36-pydanticx86_64 | Advisory build | 1.8.2-1.2 | OPENSUSE-SU-2024:11254-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python38-pydanticaarch64 | Advisory build | 1.8.2-1.2 | OPENSUSE-SU-2024:11254-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python38-pydanticppc64le | Advisory build | 1.8.2-1.2 | OPENSUSE-SU-2024:11254-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python38-pydantics390x | Advisory build | 1.8.2-1.2 | OPENSUSE-SU-2024:11254-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python38-pydanticx86_64 | Advisory build | 1.8.2-1.2 | OPENSUSE-SU-2024:11254-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python39-pydanticaarch64 | Advisory build | 1.8.2-1.2 | OPENSUSE-SU-2024:11254-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python39-pydanticppc64le | Advisory build | 1.8.2-1.2 | OPENSUSE-SU-2024:11254-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python39-pydantics390x | Advisory build | 1.8.2-1.2 | OPENSUSE-SU-2024:11254-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python39-pydanticx86_64 | Advisory build | 1.8.2-1.2 | OPENSUSE-SU-2024:11254-1 |
| Ubuntu | focal | python3-pydantic | Advisory build | 1.2-1ubuntu0.1~esm1 | USN-6553-1 |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 3.3 / 10
- Severity
- low
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| samuelcolvin | pydantic | >= 1.8.0, < 1.8.2 (affected)>= 1.7.0, < 1.7.4 (affected)< 1.6.2 (affected) | GitHub_M · cna |
Weaknesses
1- CWE-835 CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')
References
5- https://github.com/samuelcolvin/pydantic/commit/7e83fdd2563ffac081db7ecdf1affa65ef38c468
- https://github.com/samuelcolvin/pydantic/security/advisories/GHSA-5jqp-qgf6-3pvh
- FEDORA-2021-4d3de3183f https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/S2HT266L6Q7H6ICP7DFGXOGBJHNNKMKB/
- FEDORA-2021-e7fabd81fb https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/UEFWM7DYKD2ZHE7R5YT5EQWJPV4ZKYRB/
- FEDORA-2021-f8bb3ba3ec https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/UMKAJX4O6IGBBCE32CO2G7PZQCCQSBLV/
Provider assertions
2GitHub_M · cna
Use of "infinity" as an input to datetime and date fields causes infinite loop in pydantic
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.1
- Searchable
- yes
- Content hash
- 3c51d0fc110a1f7bdd660d6bb00ae0656a0f2e852dc2a6112c1ac0f8feed5d9f
- Ingested
- 23 Sep 2026, 07:53:55 UTC
- Source record
- Official CVE record