CVE-2026-133422
published medium CVSS 4.0 · 6.9Quadratic time unique_items list validation in Pydantic V1
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| pydantic | — | pydantic1.9.0 through 1.10.26 · Other versions: unaffected | Affected | Not stated | Pydantic |
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. 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.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 4.0
- Base score
- 6.9 / 10
- Severity
- medium
- Provider
- Pydantic · cna
- Vector string
- 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
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| pydantic | pydantic | 1.9.0 through 1.10.26 (affected · python)Default: unaffected | Pydantic · cna |
Weaknesses
1- CWE-407 CWE-407: Inefficient Algorithmic Complexity
References
4Provider assertions
2Pydantic · cna
Quadratic time unique_items list validation in Pydantic V1
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- ea5ae3829319c093bfd975d34735309d35bd082d256c92972f2dd57e3c87fbe3
- Ingested
- 20 Nov 2026, 17:26:19 UTC
- Source record
- Official CVE record