Bug 2577043 (CVE-2026-133276)

Summary: CVE-2026-133276 pydantic: pydantic: Validation bypass via internal initialization attribute
Product: [Other] Security Response Reporter: OSIDB Bzimport <bzimport>
Component: vulnerabilityAssignee: Product Security DevOps Team <prodsec-dev>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: alinfoot, anpicker, ansingla, aprice, bbrownin, blitton, brasmith, cahl, cmyers, cochase, dfreiber, dkeler, dnakabaa, dranck, drow, dtrifiro, dymurray, eborisov, ebourniv, ehelms, gbenhaim, gtanzill, hasun, ilpinto, jburrell, jbuscemi, jfula, jlanda, jmitchel, jowilson, jpasqual, jsamir, juwatts, kaycoth, kgaikwad, kshier, lball, lblicha, lcouzens, ljawale, ltomasbo, mhayden, mhulan, msilmser, mwoodson, ngough, niyer, nyancey, oezr, ogajduse, ometelka, osousa, prwatson, ptisnovs, rbobbitt, rchan, rhel-process-autobot, sbunciak, sdoran, simaishi, smallamp, stcannon, suppawar, syedriko, tguha, thason, twaugh, veshanka, vkumar, watson-tool-maintainers, weaton, xdharmai, yguenane, ykashtan, zhunting
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
A flaw was found in Pydantic. When dataclass models are configured to allow extra fields, an attacker can bypass data validation by providing an internal initialization attribute in the input payload. This causes Pydantic to treat the data structure as already initialized and skip all field type and value checks. Consequently, applications may process unvalidated or malformed data, potentially compromising data integrity or causing unexpected application behavior.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2578218, 2578238, 2578219, 2578237    
Bug Blocks:    

Description OSIDB Bzimport 2026-11-19 16:21:44 UTC
### 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`).