PyPI
CVE-2026-133422
Quadratic time unique_items list validation in Pydantic V1
- Severity
- Medium 6.9
- Published
- 20 Nov 2026
- Last changed
- 20 Nov 2026
- Added to UpHeron
- 23 Nov 2026
- Exploit chance
- 0.8% in the next 30 daysHigher than 58% of CVEs. EPSS by FIRST, 24 Nov 2026
- Attack
- Over the network · No login needed · No user action needed
- Attacker can
- Slow it down
- CVSS vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N- Sources
- CVE Program
Description
Validating 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.
Affected software
| Software | Affected versions |
|---|---|
pydanticPyPI · osv:PyPI:pydantic |
|
About pydantic
- Weekly downloads (PyPI)
- 288,782,721PyPI Stats, 23 Nov 2026
Vulnerabilities in pydantic
- In our list
- 7
- Published in the last 12 months
- 7
- Critical, last 12 months
- 0
- High, last 12 months
- 0
- Known exploited
- 0
- CVE-2026-133421Quadratic time timedelta validation in Pydantic V1Medium 6.9 20 Nov 2026
- CVE-2026-133424Validation bypass of aliased fields in TypedDict and dataclasses allowing extra dataMedium 6.3 20 Nov 2026
- CVE-2026-133426Unbounded exponent in Fraction validationMedium 6.3 20 Nov 2026
- CVE-2026-133428Quadratic time and memory multi-host URL validationMedium 6.3 20 Nov 2026
- CVE-2026-133429Validation bypass of extra data keys in JSON model validationMedium 6.3 20 Nov 2026
- CVE-2026-133276Validation bypass of Pydantic V1 dataclasses allowing extra dataMedium 6.3 19 Nov 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-133422