Bug 2578018 - CVE-2026-133422 python-pydantic: pydantic: Denial of Service via inefficient unique items validation [fedora-all]
Summary: CVE-2026-133422 python-pydantic: pydantic: Denial of Service via inefficient ...
Keywords:
Status: ASSIGNED
Alias: None
Product: Fedora
Classification: Fedora
Component: python-pydantic
Version: rawhide
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Ben Beasley
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: {"flaws": ["b6a54903-c0f5-479c-aee8-9...
Depends On:
Blocks: CVE-2026-133422
TreeView+ depends on / blocked
 
Reported: 2026-11-20 10:17 UTC by Avinash Hanwate
Modified: 2026-11-20 10:27 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Avinash Hanwate 2026-11-20 10:17:55 UTC
Disclaimer: Community trackers are created by Red Hat Product Security team on a best effort basis. Package maintainers are required to ascertain if the flaw indeed affects their package, before starting the update process.

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.

Comment 1 Ben Beasley 2026-11-20 10:27:34 UTC
Rawhide already has Pydantic ≥ 2.14.2, and all other branches can’t and won’t be updated due to various breaking changes. So the only question is whether this can be backported. Commit 6ec75e57f277a820ec583e601167f25fe8dc7c87 was the fix for Pydantic V1, which we don’t ship in Fedora. The “forward-port” to the pydantic.v1 namespace was https://github.com/pydantic/pydantic/commit/dd139b5ddc2fbbb63cb1a178104d35f5076ef550. I’ll investigate whether this can reasonably be cherry-picked to Pydantic 2.13.5 in F45 and to Pydantic 2.12.5 in F44. I’m not working on F43 any more since it is so close to its end-of-life date.


Note You need to log in before you can comment on or make changes to this bug.