ormar is vulnerable to SQL Injection through aggregate functions min() and max()
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- SQL injection
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-89.
Summary
Ormar is a async mini ORM for Python. In versions 0.9.9 through 0.22.0, when performing aggregate queries, Ormar ORM constructs SQL expressions by passing user-supplied column names directly into `sqlalchemy.text()` without any validation or sanitization. The `min()` and `max()` methods in the `QuerySet` class accept arbitrary string input as the column parameter. While `sum()` and `avg()` are partially protected by an `is_numeric` type check that rejects non-existent fields, `min()` and `max()` skip this validation entirely. As a result, an attacker-controlled string is embedded as raw SQL inside the aggregate function call. Any unauthorized user can exploit this vulnerability to read the entire database contents, including tables unrelated to the queried model, by injecting a subquery as the column parameter. Version 0.23.0 contains a patch.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- Yes
- Technical impact
- Total
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 |
|---|---|---|---|---|---|
| collerek | ormar | 0.9.9 to before 0.23.0 | 0.23.0 | Patch available | CNA |
| — | ormar (PyPI) | 0.9.9 to before 0.23.0 | 0.23.0 | Patch available | GHSA-xxh2-68g9-8jqr |
- ormar Vendorcollerek Affected 0.9.9 to before 0.23.0 Fixed in 0.23.0 Patch available CNA
- ormar (PyPI) Vendor— Affected 0.9.9 to before 0.23.0 Fixed in 0.23.0 Patch available GHSA-xxh2-68g9-8jqr
Remediation
- Fix · CNA ormar (collerek) Fixed in 0.23.0
- Fix · GHSA-xxh2-68g9-8jqr ormar (PyPI) Fixed in 0.23.0 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2026-26198
- 2026-10-03 Alias added: GHSA-xxh2-68g9-8jqr
References
More collerek Ormar vulnerabilities
- TI-2026-22297 ormar has a Pydantic Validation Bypass via Kwargs Injection in Model Constructor CVSS 3.1CRITICAL 9.8
Sources
- CVE-2026-26198 · CVE Program
- CVE-2026-26198 · NVD
- FIRST EPSS
- GHSA-xxh2-68g9-8jqr · 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