Bug 2577864 (CVE-2026-133422)

Summary: CVE-2026-133422 pydantic: pydantic: Denial of Service via inefficient unique items validation
Product: [Other] Security Response Reporter: OSIDB Bzimport <bzimport>
Component: vulnerabilityAssignee: Product Security DevOps Team <prodsec-dev>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: alinfoot, anpicker, ansingla, aprice, bbrownin, blitton, brasmith, cahl, cmyers, cochase, dfreiber, dkeler, dnakabaa, dranck, drow, dtrifiro, dymurray, eborisov, ebourniv, ehelms, gbenhaim, gtanzill, hasun, ilpinto, jburrell, jbuscemi, jfula, jlanda, jmitchel, jowilson, jpasqual, jsamir, juwatts, kaycoth, kgaikwad, kshier, lball, lblicha, lcouzens, ljawale, ltomasbo, mhayden, mhulan, msilmser, mwoodson, ngough, niyer, nyancey, oezr, ogajduse, ometelka, osousa, prwatson, ptisnovs, rbobbitt, rchan, rhel-process-autobot, sbunciak, sdoran, simaishi, smallamp, stcannon, suppawar, syedriko, tguha, thason, twaugh, veshanka, vkumar, watson-tool-maintainers, weaton, xdharmai, yguenane, ykashtan, zhunting
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
A flaw was found in pydantic. This vulnerability allows a remote attacker to cause a Denial of Service (DoS) through excessive CPU consumption. The issue occurs when validating input data in fields configured to enforce unique list items, which performs inefficient comparisons that scale quadratically with list size. By submitting a large list of values, an attacker can exhaust system processing resources and render the application unresponsive.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2578017, 2578018    
Bug Blocks:    

Description OSIDB Bzimport 2026-11-20 07:41:40 UTC
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.