Bug 2578017 - CVE-2026-133422 python-pydantic: pydantic: Denial of Service via inefficient unique items validation [epel-all]
Summary: CVE-2026-133422 python-pydantic: pydantic: Denial of Service via inefficient ...
Keywords:
Status: ASSIGNED
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: python-pydantic
Version: epel10
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Maxwell G
QA Contact:
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:29 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:52 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:29:20 UTC
Neither EPEL10 nor EPEL9 can be updated due to a mix of dependency limitations and breaking changes.

Commit 6ec75e57f277a820ec583e601167f25fe8dc7c87 was the fix for Pydantic V1. I can investigate whether it is practical to backport to Pydantic 1.10.14 in EPEL9.

The “forward-port” to the pydantic.v1 namespace for Pydantic V2 was https://github.com/pydantic/pydantic/commit/dd139b5ddc2fbbb63cb1a178104d35f5076ef550. I’ll investigate whether this can reasonably be cherry-picked to Pydantic 2.9.2 in EPEL10.


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