Skip to content

CVE-2026-26198 ormar is vulnerable to SQL Injection through aggregate functions min() and max()

HighCVSS 7.5 EPSS 1.00%
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.

PackageAffectedFixed inStatus
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

ProductAffected versionsFixed 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
ProductAffected versionsFixed 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