Validation bypass of Pydantic V1 dataclasses allowing extra data
- State
- Published
- Severity
- 6.3 Medium
- Published
- Nov 19, 2026
- Updated
- Nov 19, 2026
- Reserved
- Nov 19, 2026
Description
When extra data is allowed (extra=Extra.allow), providing a __pydantic_initialised__ key when validating a Pydantic V1 dataclass makes it considered as already validated, resulting in field values not being validated. The __init__() method of Pydantic V1 dataclasses stores all the provided keyword arguments in the instance __dict__ before validation, so a __pydantic_initialised__ keyword argument overrides the internal flag used to skip validation of already validated instances. As a result, data returned by validation doesn't match the declared type. Affected are applications validating untrusted data into Pydantic V1 dataclasses allowing extra data. The issue was fixed in Pydantic 1.10.27. Users relying on the pydantic.v1 namespace in Pydantic V2 should upgrade to 2.14.2 or later.
| Product | Versions |
|---|---|
| pydantic pydantic | 1.10.0 to before 1.10.27 Affected |
| CVSS | Score | How It's Reached | Source |
|---|---|---|---|
| 4.0 | 6.3 Medium | Pydantic |
Weaknesses
- CWE-20 Improper Input Validation
References
- https://github.com/pydantic/pydantic/security/advisories/GHSA-r49w-vh47-r4hfVendor Advisory
- https://github.com/pydantic/pydantic/blob/v1.10.26/pydantic/dataclasses.py#L295-L298
- https://github.com/pydantic/pydantic/blob/v1.10.26/pydantic/dataclasses.py#L430-L434
- https://github.com/pydantic/pydantic/commit/b26913fe6
- https://github.com/pydantic/pydantic/releases/tag/v2.14.2
Every record here comes from the CVE Program's CVE List. © 1999-2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.