PT-2026-21607 · Ormar · Ormar
Aatomical
·
Published
2026-02-23
·
Updated
2026-03-01
·
CVE-2026-26198
CVSS v3.1
9.8
Critical
| Vector | AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Name of the Vulnerable Software and Affected Versions
Ormar versions 0.9.9 through 0.22.0
Description
Ormar is an async mini ORM for Python. Versions 0.9.9 through 0.22.0 are susceptible to a SQL injection flaw when performing aggregate queries. The
min() and max() methods in the QuerySet class accept arbitrary string input as the column parameter without validation. This allows an attacker to embed raw SQL inside the aggregate function call, potentially enabling them to read the entire database content, including unrelated tables, by injecting a subquery. The vulnerability arises because sqlalchemy.text() is used to construct SQL expressions directly from user-supplied column names without sanitization. The sum() and avg() methods have partial protection with a type check, but min() and max() do not. The vulnerability was discovered through the ability to execute subqueries via the min() and max() aggregate functions. An attacker can enumerate database tables, extract schemas, and dump credentials without authentication.Recommendations
Update to version 0.23.0 or later.
Exploit
Fix
SQL injection
Found an issue in the description? Have something to add? Feel free to write us 👾
Weakness Enumeration
Related Identifiers
Affected Products
Ormar