Collerek ormar
ormar is vulnerable to SQL Injection through aggregate functions min() and max()
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.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- >= 0.9.9, < 0.23.0
Fixed in 0.23.0
Mitigation
Upgrade ormar to 0.23.0 or later.
References
- Vendor advisory github.com/collerek/ormar/security/advisories/…
- Patch github.com/collerek/ormar/commit/a03bae14fe013…
- Release notes github.com/collerek/ormar/releases/tag/0.23.0
Timeline
Days relative to CVE publicationFirst public PoC 29 days after publication; not in CISA KEV. First PoC: sergicortesabadia/CVE-2026-26198-analysis (created 25 Mar 2026, found by us: backfilled).
PoC repositories
Found on GitHub.1 PoCs · 1 informational
PoCs 1
| Repository | Created | Stars | Assessment |
|---|---|---|---|
| sergicortesabadia/CVE-2026-26198-analysis | 25 Mar 2026 +29 d | 0 | PoC
Flags · score 15
Below the suspicion threshold (50); does not change the assessment. |
Informational 1
| Repository | Created | Stars | Assessment |
|---|---|---|---|
| NetVanguard-cmd/CVE-2026-26198 | 19 Apr 2026 +54 d | 0 | Informational · write-up |
Only PoCs count toward the first-PoC date and the characteristics below. Do not run PoC code from unknown sources.