CVE-2026-133422Quadratic time unique_items list validation in Pydantic V1
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.
What to do
Fixed builds are available from Debian: see the table below for the fixed version per release.
Debian, Red Hat, Ubuntu have not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.04 | pydantic | Not affected vulnerable_code_not_present | ||
| Ubuntu 24.04 | pydantic | Under investigation | UBUNTU-CVE-2026-133422 | |
| Ubuntu 22.04 | pydantic | Fix pending | UBUNTU-CVE-2026-133422 | |
| Ubuntu 20.04 | pydantic | Fix pending | UBUNTU-CVE-2026-133422 | |
| Debian 14 | pydantic | Fixed | 2.4.2-1 | DEBIAN-CVE-2026-133422 |
| Debian 13 | pydantic | Fixed | 2.4.2-1 | DEBIAN-CVE-2026-133422 |
| Debian 12 | pydantic | Fix pending | DEBIAN-CVE-2026-133422 | |
| Red Hat Enterprise Linux 10 | linux-mcp-server | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | linux-mcp-server | Fix pending Fix deferred |
What the vendor says
As published in the CVE record by Pydantic, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- pydantic: affected: 1.9.0 to 1.10.26
Vendor advisories:
References
- https://github.com/pydantic/pydantic/security/advisories/GHSA-49g6-96jj-f7r9
- https://github.com/pydantic/pydantic/blob/v1.10.26/pydantic/types.py#L612-L620
- https://github.com/pydantic/pydantic/commit/6ec75e57f277a820ec583e601167f25fe8dc7c87
- https://github.com/pydantic/pydantic/releases/tag/v2.14.2
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.