Bug 2578237 - CVE-2026-133276 python-pydantic: pydantic: Validation bypass via internal initialization attribute [epel-all]
Summary: CVE-2026-133276 python-pydantic: pydantic: Validation bypass via internal ini...
Keywords:
Status: CLOSED DUPLICATE of bug 2578218
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: python-pydantic
Version: epel10
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Maxwell G
QA Contact:
URL:
Whiteboard: {"flaws": ["c6e5a6ff-adad-46c9-b39c-d...
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:55 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2026-11-20 21:55:40 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Avinash Hanwate 2026-11-20 13:53:46 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:55:40 UTC

*** This bug has been marked as a duplicate of bug 2578218 ***


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