CVE-2026-26198 ormar is vulnerable to SQL Injection through aggregate functions min() and max()
Attackers can inject SQL via min/max aggregate functions to read entire database contents, affecting users of the Ormar Python ORM.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2026-26198?
CVE-2026-26198 is a critical SQL injection vulnerability in collerek ormar, published on 24 Feb 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official 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.
Weakness: CWE-89
Which versions are affected by CVE-2026-26198?
3 open source packages ship an affected version, including ormar. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
ormar PyPI | From 0.9.9 | 0.23.0 |
ormar PyPI | From 0.9.9 | 0.23.0 |
ormar PyPI | From 0.9.9 | 0.23.0 |
Products include Collerek Ormar.
How do I fix CVE-2026-26198?
Upgrade ormar to 0.23.0 or later.
Use parameterised queries everywhere and never build SQL by joining strings. Upgrade affected software first; a web application firewall only buys time. More about SQL injection.
Is CVE-2026-26198 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-26198 exists.
Public exploit code: 2 proofs of concept on GitHub.
Other vulnerabilities in collerek ormar
Sources
Also known as DEBIAN-CVE-2026-26198, GHSA-xxh2-68g9-8jqr, PYSEC-2026-439, UBUNTU-CVE-2026-26198.