CVE-2026-26198 ormar is vulnerable to SQL Injection through aggregate functions min() and max()
- Published
- Updated
- Exploit status
- No public exploit known
- CISA SSVC
- Proof of concept public · automatable: yes · technical impact: total
- Technology
- UbuntuDebian
Description
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.
Upgrade path
7 packages: 3 fixed, 4 with no fix yet.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| debian/ormar(Debian 12) | = 0.12.0-3; = 0.12.2-1; = 0.20.2-1; = 0.21.0-1 +6 more | No fix listed | No fix yet |
| ubuntu/ormar(Ubuntu 24.04) | All versions | No fix listed | No fix yet |
| ubuntu/ormar(Ubuntu 26.04) | All versions | No fix listed | No fix yet |
| ubuntu/ormar(Ubuntu 26.10) | All versions | No fix listed | No fix yet |
| collerek ormar | = >= 0.9.9, < 0.23.0; >= 0.9.9, < 0.23.0 | 0.23.0 | Fixed |
| debian/ormar(Debian 14) | < 0.23.0-1; = 0.11.2-1; = 0.11.2-2; = 0.11.2-3 +8 more | 0.23.0-1 | Fixed |
| pypi ormar(PyPI) | = 0.9.9; = 0.10.0; = 0.10.1; = 0.10.2 +37 more | 0.23.0 | Fixed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| collerek ormar | = >= 0.9.9, < 0.23.0 | No fix listed |
| debian/ormar(Debian:12) | All versions | No fix listed |
| debian/ormar(Debian:14) | < 0.23.0-1 | 0.23.0-1 |
| pypi ormar(PyPI) | >= 0.9.9, < 0.23.0 | 0.23.0 |
| pypi ormar(PyPI) | = 0.10.0 | No fix listed |
| pypi ormar(PyPI) | = 0.10.1 | No fix listed |
| pypi ormar(PyPI) | = 0.10.10 | No fix listed |
| pypi ormar(PyPI) | = 0.10.11 | No fix listed |
| pypi ormar(PyPI) | = 0.10.12 | No fix listed |
| pypi ormar(PyPI) | = 0.10.13 | No fix listed |
| pypi ormar(PyPI) | = 0.10.14 | No fix listed |
| pypi ormar(PyPI) | = 0.10.15 | No fix listed |
| pypi ormar(PyPI) | = 0.10.16 | No fix listed |
| pypi ormar(PyPI) | = 0.10.17 | No fix listed |
| pypi ormar(PyPI) | = 0.10.18 | No fix listed |
| pypi ormar(PyPI) | = 0.10.19 | No fix listed |
| pypi ormar(PyPI) | = 0.10.2 | No fix listed |
| pypi ormar(PyPI) | = 0.10.20 | No fix listed |
| pypi ormar(PyPI) | = 0.10.21 | No fix listed |
| pypi ormar(PyPI) | = 0.10.22 | No fix listed |
| pypi ormar(PyPI) | = 0.10.23 | No fix listed |
| pypi ormar(PyPI) | = 0.10.24 | No fix listed |
| pypi ormar(PyPI) | = 0.10.25 | No fix listed |
| pypi ormar(PyPI) | = 0.10.3 | No fix listed |
| pypi ormar(PyPI) | = 0.10.4 | No fix listed |
Show 43 more
| Product | Affected versions | Fixed in |
|---|---|---|
| pypi ormar(PyPI) | = 0.10.5 | No fix listed |
| pypi ormar(PyPI) | = 0.10.6 | No fix listed |
| pypi ormar(PyPI) | = 0.10.7 | No fix listed |
| pypi ormar(PyPI) | = 0.10.8 | No fix listed |
| pypi ormar(PyPI) | = 0.10.9 | No fix listed |
| pypi ormar(PyPI) | = 0.11.0 | No fix listed |
| pypi ormar(PyPI) | = 0.11.1 | No fix listed |
| pypi ormar(PyPI) | = 0.11.2 | No fix listed |
| pypi ormar(PyPI) | = 0.11.3 | No fix listed |
| pypi ormar(PyPI) | = 0.12.0 | No fix listed |
| pypi ormar(PyPI) | = 0.12.1 | No fix listed |
| pypi ormar(PyPI) | = 0.12.2 | No fix listed |
| pypi ormar(PyPI) | = 0.12.3 | No fix listed |
| pypi ormar(PyPI) | = 0.20.0 | No fix listed |
| pypi ormar(PyPI) | = 0.20.1 | No fix listed |
| pypi ormar(PyPI) | = 0.20.2 | No fix listed |
| pypi ormar(PyPI) | = 0.21.0 | No fix listed |
| pypi ormar(PyPI) | = 0.22.0 | No fix listed |
| pypi ormar(PyPI) | = 0.9.9 | No fix listed |
| debian/ormar(Debian:12) | = 0.12.0-3 | No fix listed |
| debian/ormar(Debian:12) | = 0.12.2-1 | No fix listed |
| debian/ormar(Debian:12) | = 0.20.2-1 | No fix listed |
| debian/ormar(Debian:12) | = 0.21.0-1 | No fix listed |
| debian/ormar(Debian:12) | = 0.22.0-1 | No fix listed |
| debian/ormar(Debian:12) | = 0.23.0-1 | No fix listed |
| debian/ormar(Debian:12) | = 0.23.1-1 | No fix listed |
| debian/ormar(Debian:12) | = 0.24.0-1 | No fix listed |
| debian/ormar(Debian:12) | = 0.24.0-2 | No fix listed |
| debian/ormar(Debian:14) | = 0.11.2-1 | No fix listed |
| debian/ormar(Debian:14) | = 0.11.2-2 | No fix listed |
| debian/ormar(Debian:14) | = 0.11.2-3 | No fix listed |
| debian/ormar(Debian:14) | = 0.11.3-1 | No fix listed |
| debian/ormar(Debian:14) | = 0.12.0-1 | No fix listed |
| debian/ormar(Debian:14) | = 0.12.0-2 | No fix listed |
| debian/ormar(Debian:14) | = 0.12.0-3 | No fix listed |
| debian/ormar(Debian:14) | = 0.12.2-1 | No fix listed |
| debian/ormar(Debian:14) | = 0.20.2-1 | No fix listed |
| debian/ormar(Debian:14) | = 0.21.0-1 | No fix listed |
| debian/ormar(Debian:14) | = 0.22.0-1 | No fix listed |
| ubuntu/ormar(Ubuntu:24.04) | All versions | No fix listed |
| ubuntu/ormar(Ubuntu:26.04) | All versions | No fix listed |
| ubuntu/ormar(Ubuntu:26.10) | All versions | No fix listed |
| collerek ormar | >= 0.9.9, < 0.23.0 | 0.23.0 |
References
- https://github.com/collerek/ormar/security/advisories/GHSA-xxh2-68g9-8jqr exploit vendor-advisory
- https://github.com/collerek/ormar/commit/a03bae14fe01358d3eaf7e319fcd5db2e4956b16 patch
- https://github.com/collerek/ormar/releases/tag/0.23.0 product release-notes
- Debian Security Tracker CVE-2026-26198 vendor-advisory
- bugs.debian.org issue-tracking
- nvd.nist.gov third-party-advisory vendor-advisory
- github.com product
- pypi.org product
- github.com vendor-advisory
- Ubuntu CVE tracker vendor-advisory
- www.cve.org
- github.com