Skip to content
Heist/ feed
Back to feed
High

Security advisory

Type: advisorySources: OSVCVE: CVE-2021-29510

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2021-29510
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 12:04 UTC · Revision 1

Source evidence

CVE-2021-29510

core-osv · Original source

Published 13 May 2021, 19:15 UTC

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.

osv:CVE-2021-29510
Complete source record
{
  "id": "a26c829db4400ecc47319957f0d17a7bc7f94fbe03005e0582ebe70e0ce33bc1",
  "url": "https://osv.dev/vulnerability/CVE-2021-29510",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2021-29510",
    "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.",
    "evidence": "osv:CVE-2021-29510",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2021-29510",
      "aliases": [
        "CVE-2021-29510",
        "GHSA-5jqp-qgf6-3pvh",
        "PYSEC-2021-47"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/pydantic/pydantic",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "acf778345d516a78d93c08459ab4cd4c6709a6be"
                },
                {
                  "introduced": "95435de4526b609ee904b7a27478cec2e32f8fe8"
                },
                {
                  "fixed": "e3d1c161d79d54e0e2d549f96e7b458d74088205"
                },
                {
                  "introduced": "a8d50aef0c375374302d050fbe16703d33aaeb86"
                },
                {
                  "fixed": "a84cfacf9caf08bef8edca076c3325c3cf49475d"
                },
                {
                  "fixed": "7e83fdd2563ffac081db7ecdf1affa65ef38c468"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:pydantic:pydantic:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "1.6.2"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:pydantic:pydantic:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "1.7"
                      },
                      {
                        "fixed": "1.7.4"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:pydantic:pydantic:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "1.8"
                      },
                      {
                        "fixed": "1.8.2"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "7e83fdd2563ffac081db7ecdf1affa65ef38c468"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v1.6.1",
            "v1.7.3",
            "v1.8.1",
            "v1.8",
            "v1.7.2",
            "v1.7.1",
            "v1.7",
            "v1.6",
            "v1.5.1",
            "v1.5",
            "v1.4",
            "v1.3",
            "v1.2",
            "v1.1",
            "v1.0",
            "v1.0b2",
            "v1.0b1",
            "v0.32",
            "v0.31.1",
            "v0.31",
            "v0.30.1",
            "v0.30",
            "v0.29",
            "v0.28",
            "v0.27",
            "v0.26",
            "v0.25",
            "v0.24",
            "v0.23",
            "v0.22",
            "v0.21",
            "v0.20.1",
            "v0.20",
            "v0.20a1",
            "v0.19",
            "v0.18.2",
            "v0.18.1",
            "v0.18",
            "V0.17",
            "v0.16.1",
            "v0.16",
            "v0.15",
            "v0.14",
            "v0.13.1",
            "v0.13",
            "v0.12.1",
            "v0.12",
            "v0.11.2",
            "v0.11.1",
            "v0.11",
            "v0.10",
            "v0.9.1",
            "v0.9",
            "v0.8",
            "v0.7.1",
            "v0.7",
            "v0.6.4",
            "v0.6.3",
            "v0.6.2",
            "v0.6.1",
            "v0.6",
            "v0.5",
            "v0.4",
            "v0.3",
            "v0.2.1",
            "v0.2",
            "v0.1",
            "v0.0.8",
            "v0.0.7",
            "v0.0.6",
            "v0.0.5",
            "v0.0.4",
            "v0.0.3",
            "v0.0.2"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-29510.json"
          }
        }
      ],
      "modified": "2026-10-20T10:55:15.024628687Z",
      "provider": "osv",
      "references": [
        "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/S2HT266L6Q7H6ICP7DFGXOGBJHNNKMKB/",
        "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/UEFWM7DYKD2ZHE7R5YT5EQWJPV4ZKYRB/",
        "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/UMKAJX4O6IGBBCE32CO2G7PZQCCQSBLV/",
        "https://github.com/samuelcolvin/pydantic/commit/7e83fdd2563ffac081db7ecdf1affa65ef38c468",
        "https://github.com/samuelcolvin/pydantic/security/advisories/GHSA-5jqp-qgf6-3pvh"
      ],
      "provider_metadata": {
        "unresolved_ranges": [
          {
            "cpes": [
              "cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:*",
              "cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*"
            ],
            "vendor_product": "fedoraproject:fedora",
            "extracted_events": [
              {
                "range": [
                  {
                    "introduced": "33"
                  },
                  {
                    "last_affected": "33"
                  },
                  {
                    "introduced": "34"
                  },
                  {
                    "last_affected": "34"
                  }
                ],
                "source": "CPE_STRING"
              }
            ]
          }
        ]
      }
    },
    "related_cves": [
      {
        "value": "CVE-2021-29510",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 387067,
  "published_at": "2021-05-13T19:15:08.023+00:00"
}