CVE-2026-133429: Validation bypass of extra data keys in JSON model validation

Published Nov 20, 2026
·
Updated

When validating JSON data into a model allowing extra data, the keys of extra data aren't validated against the key type annotated on pydanticextra, resulting in extra data not matching the declared type. This is the case if you define pydanticextra as e.g. dict[Annotated[str, Field(pattern=r'^x')], int].

The validatejsonbyiteration() method (in pydantic-core/src/validators/modelfields.rs), used to validate JSON data into models, only validates the values of extra data, and stores the keys as is.

The issue was fixed in commit 4c65dbda9970a488e2ff21c8693fc6f6d70a3358.

Impact: validation bypass, as extra data returned by validation doesn't match the declared type. Affected are applications validating untrusted JSON data into models allowing extra data (with extra='allow'), with a key type annotated on pydanticextra (e.g. dict[Annotated[str, Field(pattern=...)], int]), using Pydantic from 2.13.0 up to (but excluding) 2.14.2.

Python mode validation isn't affected.

Affected Software

1 affected component
pypi/pydantic>=2.13.0<2.14.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 2.14.2

Event History

Nov 20, 2026
CVE Published
via MITRE·07:32 AM
Data Sourced
via MITRE·07:32 AM
DescriptionWeakness
Data Sourced
via OSV·07:32 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·08:18 AM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which applications are affected by this issue?

Applications are affected when they validate untrusted JSON into Pydantic models configured with extra='allow' and declare a constrained key type on __pydantic_extra__. The affected Pydantic versions are 2.13.0 through versions before 2.14.2.

2

What does an attacker need to exploit the validation bypass?

An attacker needs to supply JSON data to an affected validation path. The supplied JSON must include extra fields whose keys do not satisfy the constraints declared for __pydantic_extra__; the vulnerable JSON validation path stores those keys without validating them.

3

Are default Pydantic model configurations affected?

No. The issue requires models that explicitly allow extra data with extra='allow' and that annotate __pydantic_extra__ with a key type constraint. Python-mode validation is also not affected.

4

What can be done if upgrading is not immediately possible?

Avoid validating untrusted input through the affected JSON path for models that allow extra fields with constrained extra-data keys. Reject unexpected fields or perform separate validation of extra-data keys before relying on the validated model output.

5

How can I determine whether my application is exposed?

Review models receiving untrusted JSON for extra='allow' and an __pydantic_extra__ annotation such as dict[Annotated[str, Field(pattern=...)], int]. Test JSON validation with an extra key that violates the declared key constraint; on an affected version, the key can appear in the validated extra data unchanged.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203