Skip to content

← Public intelligence

PyPI package

pydantic

Open actionable advisories and recorded vendor fixes. This public package view has no inventory attached and cannot establish whether your deployment is affected. A vendor fix never resolves your finding; verify your installed version and the source guidance.

Open advisories

2 actionable advisories, newest first. Withdrawn advisories and news are excluded. Coverage is partial.

  1. Medium, CVSS 5.9PyPIAmendedPublished

    Pydantic regular expression denial of service

    CVE-2024-3772 · GHSA-mr82-8j83-vxmv

    Affected
    • PyPI pydantic >= 2.0.0, < 2.4.0; < 1.10.13
    Fixed in
    2.4.01.10.13· Vendor fix available
    Issue
    Regular expression denial of service in Pydantic < 2.4.0, < 1.10.13 allows remote attackers to cause denial of service via a crafted email string.

    Recommended action: Upgrade to 2.4.0 or 1.10.13 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  2. Medium, CVSS 5.3PyPIAmendedPublished

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

    CVE-2021-29510 · GHSA-5jqp-qgf6-3pvh

    Affected
    • PyPI pydantic < 1.6.2; >= 1.8, < 1.8.2; >= 1.7, < 1.7.4
    Fixed in
    1.7.41.8.21.6.2· Vendor fix available
    Issue
    Impact 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). Patches Pydantic is be patched with fixes available in the following versions: v1.8.2 v1.7.4 v1.6.2 All these versions are available on pypi, and will be available on conda-forge soon. See the changelog for details. Workarounds If you absolutely can't upgrade, you can work around this risk using a validator to catch these values, brief demo: from datetime import date from pydantic import BaseModel, validator class DemoModel(BaseModel): dateofbirth: date @validator('dateofbirth', pre=True) def skipinfinitevalues(cls, v): try: seconds = float(v) except (ValueError, TypeError): return v else: if seconds == float('inf'): return date.max elif seconds == float('-inf'): return date.min else: return seconds Note: this is not an ideal solution (in particular you'll need a slightly different function for datetimes), instead…

    Recommended action: Upgrade to 1.8.2, 1.7.4 or 1.6.2 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →