ormar has a Pydantic Validation Bypass via Kwargs Injection in Model Constructor
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Tampering
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · NVD. Fix status from CNA and GitHub. Impact type from CWE-915.
Summary
ormar is a async mini ORM for Python. Versions 0.23.0 and below are vulnerable to Pydantic validation bypass through the model constructor, allowing any unauthenticated user to skip all field validation by injecting "__pk_only__": true into a JSON request body. By injecting "__pk_only__": true into a JSON request body, an unauthenticated attacker can skip all field validation and persist unvalidated data directly to the database. A secondary __excluded__ parameter injection uses the same pattern to selectively nullify arbitrary model fields (e.g., email or role) during construction. This affects ormar's canonical FastAPI integration pattern recommended in its official documentation, enabling privilege escalation, data integrity violations, and business logic bypass in any application using ormar.Model directly as a request body parameter. This issue has been fixed in version 0.23.1.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| ormar-orm | ormar | before 0.23.1 | 0.23.1 | Patch available | CNA |
| — | ormar (PyPI) | before 0.23.1 | 0.23.1 | Patch available | GHSA-f964-whrq-44h8 |
- ormar Vendorormar-orm Affected before 0.23.1 Fixed in 0.23.1 Patch available CNA
- ormar (PyPI) Vendor— Affected before 0.23.1 Fixed in 0.23.1 Patch available GHSA-f964-whrq-44h8
Remediation
- Fix · CNA ormar (ormar-orm) Fixed in 0.23.1
- Fix · GHSA-f964-whrq-44h8 ormar (PyPI) Fixed in 0.23.1 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2026-27953
- 2026-10-03 Alias added: GHSA-f964-whrq-44h8
References
Patch 7
- https://github.com/ormar-orm/ormar/commit/7f22aa21a7614b993970345b392dabb0ccde0ab3
- https://github.com/ormar-orm/ormar/blob/master/examples/fastapi_quick_start.py#L55
- https://github.com/ormar-orm/ormar/blob/master/ormar/fields/foreign_key.py#L41
- https://github.com/ormar-orm/ormar/blob/master/ormar/models/helpers/pydantic.py#L108
- https://github.com/ormar-orm/ormar/blob/master/ormar/models/model.py#L89
- https://github.com/ormar-orm/ormar/blob/master/ormar/models/newbasemodel.py#L128
- https://github.com/ormar-orm/ormar/blob/master/ormar/models/newbasemodel.py#L292
More collerek Ormar vulnerabilities
- TI-2026-21189 ormar is vulnerable to SQL Injection through aggregate functions min() and max() CVSS 3.1CRITICAL 9.8
Sources
- CVE-2026-27953 · CVE Program
- CVE-2026-27953 · NVD
- FIRST EPSS
- GHSA-f964-whrq-44h8 · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences