Improper Validation of Specified Quantity in Input Affecting pydantic package, versions [2.13.0,2.14.2)


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.55% (40th 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-22733161
  • published22 Nov 2026
  • disclosed20 Nov 2026
  • creditGanni Galea Curmi

Introduced: 20 Nov 2026

NewCVE-2026-133429  (opens in a new tab)
CWE-1284  (opens in a new tab)

How to fix?

Upgrade pydantic to version 2.14.2 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 Improper Validation of Specified Quantity in Input via the validate_json_by_iteration() method in pydantic-core/src/validators/model_fields.rs, which only validates the values of extra fields but stores their keys as-is without applying the key validator declared on __pydantic_extra__. An attacker supplying JSON data with extra keys that violate the annotated key type constraint (for example a Field(pattern=...) restriction) can bypass that constraint, causing the validated model to contain extra data that does not match the declared type.

Note: This is only exploitable when a model is configured with extra='allow' and __pydantic_extra__ is annotated with a constrained key type (e.g. dict[Annotated[str, Field(pattern=...)], int]), and Python mode validation is not affected.

CVSS Base Scores

version 4.0
version 3.1