{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-133429","assignerOrgId":"7cec5f2f-3032-4006-8740-31f605ffab5f","state":"PUBLISHED","assignerShortName":"Pydantic","dateReserved":"2026-11-19T19:50:17.136Z","datePublished":"2026-11-20T07:32:01.421Z","dateUpdated":"2026-11-20T17:18:45.072Z"},"containers":{"cna":{"title":"Validation bypass of extra data keys in JSON model validation","descriptions":[{"lang":"en","value":"When validating JSON data into a model allowing extra data, the keys of extra data aren't validated against the key type annotated on __pydantic_extra__, resulting in extra data not matching the declared type. This is the case if you define __pydantic_extra__ as e.g. dict[Annotated[str, Field(pattern=r'^x_')], int].\n\nThe validate_json_by_iteration() method (in pydantic-core/src/validators/model_fields.rs), used to validate JSON data into models, only validates the values of extra data, and stores the keys as is.\n\nThe issue was fixed in commit 4c65dbda9970a488e2ff21c8693fc6f6d70a3358.\n\nImpact: 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 __pydantic_extra__ (e.g. dict[Annotated[str, Field(pattern=...)], int]), using Pydantic from 2.13.0 up to (but excluding) 2.14.2.\n\nPython mode validation isn't affected.","supportingMedia":[{"type":"text/html","base64":false,"value":"<h3>Summary</h3>\n<p>When validating JSON data into a model allowing extra data, the keys of extra data aren't validated against the key type annotated on <code>__pydantic_extra__</code>, resulting in extra data not matching the declared type. This is the case if you define <code>__pydantic_extra__</code> as e.g. <code>dict[Annotated[str, Field(pattern=r'^x_')], int]</code>.</p>\n<h3>Details</h3>\n<p>The <a href=\"https://github.com/pydantic/pydantic/blob/v2.13.5/pydantic-core/src/validators/model_fields.rs#L540\"><code>validate_json_by_iteration()</code></a> method (in <code>pydantic-core/src/validators/model_fields.rs</code>), used to validate JSON data into models, only validates the values of extra data, and stores the keys as is (<a href=\"https://github.com/pydantic/pydantic/blob/v2.13.5/pydantic-core/src/validators/model_fields.rs#L605-L623\">L605-L623</a>):</p>\n<pre><code class=\"language-rust\">ExtraBehavior::Allow =&gt; {\n    // the key is stored as is, without being validated:\n    let py_key: Bound&lt;'_, PyString&gt; = new_py_string(py, key, state.cache_str());\n    if let Some(validator) = &amp;self.extras_validator {\n        match validator.validate(py, value, state) {\n            Ok(value) =&gt; {\n                model_extra_dict.set_item(&amp;py_key, value)?;\n                fields_set.add(py_key)?;\n            }\n            // ...\n        }\n    }\n    // ...\n}\n</code></pre>\n<p>Python mode validation isn't affected.</p>\n<p>The issue was fixed in commit <a href=\"https://github.com/pydantic/pydantic/commit/4c65dbda9970a488e2ff21c8693fc6f6d70a3358\">4c65dbda9970a488e2ff21c8693fc6f6d70a3358</a>.</p>\n<h3>Impact</h3>\n<p>Validation bypass: extra data returned by validation doesn't match the declared type. Affected are applications validating untrusted JSON data into models allowing extra data (with <code>extra='allow'</code>), with a key type annotated on <code>__pydantic_extra__</code> (e.g. <code>dict[Annotated[str, Field(pattern=...)], int]</code>), using Pydantic from 2.13.0 up to (but excluding) 2.14.2.</p>\n<p>Python mode validation isn't affected.</p>"}]}],"affected":[{"vendor":"pydantic","product":"pydantic","collectionURL":"https://pypi.org","packageName":"pydantic","repo":"https://github.com/pydantic/pydantic","defaultStatus":"unaffected","versions":[{"version":"2.13.0","lessThan":"2.14.2","status":"affected","versionType":"python"}]}],"problemTypes":[{"descriptions":[{"lang":"en","type":"CWE","cweId":"CWE-20","description":"CWE-20: Improper Input Validation"}]}],"metrics":[{"cvssV4_0":{"version":"4.0","vectorString":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N","baseScore":6.3,"baseSeverity":"MEDIUM"}}],"references":[{"url":"https://github.com/pydantic/pydantic/security/advisories/GHSA-qpmf-fgh3-ff25","tags":["vendor-advisory"]},{"url":"https://github.com/pydantic/pydantic/blob/v2.13.5/pydantic-core/src/validators/model_fields.rs#L540"},{"url":"https://github.com/pydantic/pydantic/blob/v2.13.5/pydantic-core/src/validators/model_fields.rs#L605-L623"},{"url":"https://github.com/pydantic/pydantic/commit/4c65dbda9970a488e2ff21c8693fc6f6d70a3358"}],"credits":[{"lang":"en","value":"lullu57","type":"finder"}],"source":{"advisory":"GHSA-qpmf-fgh3-ff25","discovery":"UNKNOWN"},"providerMetadata":{"orgId":"7cec5f2f-3032-4006-8740-31f605ffab5f","shortName":"Pydantic","dateUpdated":"2026-11-20T07:32:01.421Z"}},"adp":[{"metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-11-20T17:18:36.430640Z","id":"CVE-2026-133429","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"title":"CISA ADP Vulnrichment","providerMetadata":{"orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","shortName":"CISA-ADP","dateUpdated":"2026-11-20T17:18:45.072Z"}}]}}