When extra data is allowed (extra=Extra.allow), providing a __pydantic_initialised__ key when validating a Pydantic V1 dataclass makes it considered a...
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| Ubuntu:Pro:20.04:LTSpydantic |
All versions→ Not listed |
Not listed |
| Ubuntu:Pro:22.04:LTSpydantic |
All versions→ Not listed |
Not listed |
| Ubuntu:24.04:LTSpydantic |
All versions→ Not listed |
Not listed |
| Ubuntu:26.10pydantic |
All versions→ Not listed |
Not listed |
| Ubuntu:26.04:LTSpydantic |
All versions→ Not listed |
Not listed |
This record does not list fixed versions. Check the article or the vendor advisory in the references for whether and where it is fixed.
Original description The description as published by the source.
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.
Source: OSV.dev (Open Source Vulnerabilities) OSV
References
- report ubuntu.com
- report cve.org
- report github.com
- report github.com
- report github.com
- report github.com
- report github.com