{"id":"UBUNTU-CVE-2026-133429","details":"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]. The 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. 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 __pydantic_extra__ (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.","modified":"2026-11-25T17:45:51Z","published":"2026-11-20T08:18:00Z","upstream":["CVE-2026-133429"],"references":[{"type":"REPORT","url":"https://ubuntu.com/security/CVE-2026-133429"},{"type":"REPORT","url":"https://www.cve.org/CVERecord?id=CVE-2026-133429"},{"type":"REPORT","url":"https://github.com/pydantic/pydantic/security/advisories/GHSA-qpmf-fgh3-ff25"},{"type":"REPORT","url":"https://github.com/pydantic/pydantic/commit/4c65dbda9970a488e2ff21c8693fc6f6d70a3358"},{"type":"REPORT","url":"https://github.com/pydantic/pydantic/blob/v2.13.5/pydantic-core/src/validators/model_fields.rs#L540"},{"type":"REPORT","url":"https://github.com/pydantic/pydantic/blob/v2.13.5/pydantic-core/src/validators/model_fields.rs#L605-L623"}],"affected":[{"package":{"name":"pydantic","ecosystem":"Ubuntu:Pro:20.04:LTS","purl":"pkg:deb/ubuntu/pydantic?arch=source&distro=esm-apps%2Ffocal"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.30.1-1","1.2-1","1.2-1ubuntu0.1~esm1","1.2-1ubuntu0.1~esm3"],"ecosystem_specific":{"binaries":[{"binary_version":"1.2-1ubuntu0.1~esm3","binary_name":"python3-pydantic"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-133429.json"}},{"package":{"name":"pydantic","ecosystem":"Ubuntu:Pro:22.04:LTS","purl":"pkg:deb/ubuntu/pydantic?arch=source&distro=esm-apps%2Fjammy"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.7.4-1","1.8.2-1","1.8.2-1ubuntu0.1~esm1"],"ecosystem_specific":{"binaries":[{"binary_name":"python3-pydantic","binary_version":"1.8.2-1ubuntu0.1~esm1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-133429.json"}},{"package":{"name":"pydantic","ecosystem":"Ubuntu:24.04:LTS","purl":"pkg:deb/ubuntu/pydantic?arch=source&distro=noble"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.10.4-1ubuntu1","1.10.13-0ubuntu1","1.10.14-1"],"ecosystem_specific":{"binaries":[{"binary_name":"python3-pydantic","binary_version":"1.10.14-1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-133429.json"}},{"package":{"name":"pydantic","ecosystem":"Ubuntu:26.10","purl":"pkg:deb/ubuntu/pydantic?arch=source&distro=stonking"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.12.5-2","2.13.4-3"],"ecosystem_specific":{"binaries":[{"binary_name":"python3-pydantic","binary_version":"2.13.4-3"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-133429.json"}},{"package":{"name":"pydantic","ecosystem":"Ubuntu:26.04:LTS","purl":"pkg:deb/ubuntu/pydantic?arch=source&distro=resolute"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.10.6-2","2.12.5-2"],"ecosystem_specific":{"binaries":[{"binary_version":"2.12.5-2","binary_name":"python3-pydantic"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-133429.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V4","score":"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","source":"CNA"},{"type":"Ubuntu","score":"medium","source":"SELF"}]}