Inefficient Algorithmic Complexity Affecting pydantic package, versions [1.9.0,1.10.27)


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.52% (38th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-PYTHON-PYDANTIC-22733160
  • published22 Nov 2026
  • disclosed20 Nov 2026
  • creditSyed Mohammad Ibrahim

Introduced: 20 Nov 2026

NewCVE-2026-133422  (opens in a new tab)
CWE-407  (opens in a new tab)

How to fix?

Upgrade pydantic to version 1.10.27 or higher.

Overview

pydantic is a Data validation and settings management using python 3.6 type hinting

Affected versions of this package are vulnerable to Inefficient Algorithmic Complexity via ConstrainedList.unique_items_validator in pydantic/types.py, which checks each item against all following items in the list, resulting in O(n²) comparisons for a list with no duplicates. An attacker can send an untrusted list of a few hundred kilobytes to a field constrained with unique_items=True (via conlist() or Field()) and cause validation to take seconds, crashing the service through resource exhaustion.

Note: This is only exploitable when an application validates untrusted input into a field constrained with unique_items=True. Pydantic V2 models are not affected; only Pydantic V1 (or the pydantic.v1 namespace in Pydantic V2) is vulnerable. After the fix, lists of non-builtin-scalar types (e.g. models or dictionaries) are still validated in quadratic time.

CVSS Base Scores

version 4.0
version 3.1