Bug 2578238 - CVE-2026-133276 python-pydantic: pydantic: Validation bypass via internal initialization attribute [fedora-all]
Summary: CVE-2026-133276 python-pydantic: pydantic: Validation bypass via internal ini...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: python-pydantic
Version: 44
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Maxwell G
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: {"flaws": ["c6e5a6ff-adad-46c9-b39c-d...
: 2578219 (view as bug list)
Depends On:
Blocks: CVE-2026-133276
TreeView+ depends on / blocked
 
Reported: 2026-11-20 13:53 UTC by Avinash Hanwate
Modified: 2026-11-20 21:54 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Avinash Hanwate 2026-11-20 13:53:51 UTC
Disclaimer: Community trackers are created by Red Hat Product Security team on a best effort basis. Package maintainers are required to ascertain if the flaw indeed affects their package, before starting the update process.

### Summary

When extra data is allowed, providing a `__pydantic_initialised__` key when validating a Pydantic V1 dataclass makes it considered as already validated, resulting in field values not being validated.

### Details

When extra data is allowed, the `__init__()` method of Pydantic V1 dataclasses stores all the provided keyword arguments in the instance `__dict__` before validation ([`pydantic/dataclasses.py`](https://github.com/pydantic/pydantic/blob/v1.10.26/pydantic/dataclasses.py#L295-L298)):

```python
elif config.extra == Extra.allow:
    for k, v in kwargs.items():
        self.__dict__.setdefault(k, v)
    init(self, *args, **{k: v for k, v in kwargs.items() if k in self.__dataclass_fields__})
```

A `__pydantic_initialised__` keyword argument thus overrides the internal flag used to skip validation of already validated instances ([`pydantic/dataclasses.py`](https://github.com/pydantic/pydantic/blob/v1.10.26/pydantic/dataclasses.py#L430-L434)):

```python
def _dataclass_validate_values(self: 'Dataclass') -> None:
    # validation errors can occur if this function is called twice on an already initialised dataclass.
    # for example if Extra.forbid is enabled, it would consider __pydantic_initialised__ an invalid extra property
    if getattr(self, '__pydantic_initialised__'):
        return
```

The issue was fixed in commit https://github.com/pydantic/pydantic/commit/b26913fe6, published in V1.10.27.

If you are relying on the `pydantic.v1` namespace in Pydantic V2, upgrade to [V2.14.2](https://github.com/pydantic/pydantic/releases/tag/v2.14.2) or later.

### Impact

Validation bypass: data returned by validation doesn't match the declared type. Affected are applications validating untrusted data into Pydantic V1 dataclasses allowing extra data (with `extra=Extra.allow`).

Comment 1 Ben Beasley 2026-11-20 21:52:28 UTC
Rawhide already has Pydantic ≥ 2.14.2, and all other branches can’t and won’t be updated due to various breaking changes. So the only question is whether this can be backported. Commit 6ec75e57f277a820ec583e601167f25fe8dc7c87 was the fix for Pydantic V1, which we don’t ship in Fedora. The “forward-port” to the pydantic.v1 namespace was https://github.com/pydantic/pydantic/commit/dd139b5ddc2fbbb63cb1a178104d35f5076ef550. I already cherry-picked this to F45 for bug 2578018, which will have fixed this issue as well.

I’m not attempting the cherry-pick for F44, https://bugzilla.redhat.com/show_bug.cgi?id=2578018#c2, and I’m not working on F43 any more since it is so close to its end-of-life date.

Comment 2 Ben Beasley 2026-11-20 21:54:38 UTC
*** Bug 2578219 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.