CVE-2026-133422

NameCVE-2026-133422
DescriptionValidating an untrusted list into a field constrained with unique_items=True with Pydantic V1 takes quadratic time: an input of a few hundred kilobytes takes seconds to validate. The ConstrainedList.unique_items_validator validator (in pydantic/types.py) checks each item against all the following ones. For a list with no duplicates (the common, valid case), this results in a quadratic number of comparisons. The issue was fixed in commit 6ec75e57f277a820ec583e601167f25fe8dc7c87. Users relying on the pydantic.v1 namespace in Pydantic V2 should upgrade to 2.14.2 or later. Impact: denial of service through validation of untrusted input. Affected are applications validating untrusted lists into fields constrained with unique_items=True (using conlist() or Field()). The fix only applies to lists of builtin scalar types (int, float, str, bytes, bool and None), for which duplicates can be detected in linear time. Lists of other types (e.g. models or dictionaries) are still checked in quadratic time, as their items aren't guaranteed to be hashable: bound their size using the max_items constraint. Pydantic V2 models are not affected.
SourceCVE (at NVD; CERT, ENISA, LWN, oss-sec, fulldisc, Debian ELTS, Red Hat, Ubuntu, Gentoo, SUSE bugzilla/CVE, GitHub advisories/code/issues, web search, more)

Vulnerable and fixed packages

The table below lists information on source packages.

Source PackageReleaseVersionStatus
pydantic (PTS)bookworm1.10.4-1+deb12u1vulnerable
trixie2.10.6-2fixed
forky, sid2.14.1-1fixed

The information below is based on the following data on fixed versions.

PackageTypeReleaseFixed VersionUrgencyOriginDebian Bugs
pydanticsource(unstable)2.4.2-1

Notes

[bookworm] - pydantic <postponed> (Minor issue, DoS)
https://github.com/pydantic/pydantic/security/advisories/GHSA-49g6-96jj-f7r9
Fixed by: https://github.com/pydantic/pydantic/commit/6ec75e57f277a820ec583e601167f25fe8dc7c87 (v1.10.27)
Upstream notes that if relying on the pydantic.v1 namespace in Pydantic V2 an
upgrade to v2.14.2. The fix is specific for 1.10.x branch. Mark first version
in 2.x series as the fixed version.

Search for package or bug name: Reporting problems