CVE-2026-26198 json
ormar is vulnerable to SQL Injection through aggregate functions min() and max()
published 8mo ago modified 3mo ago also GHSA-xxh2-68g9-8jqr , PYSEC-2026-439 , EUVD-2026-7409
- cvss
- 9.8
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 1.0%
- EPSS 1.0% chance of exploitation in 30 days, percentile 63%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- pypi ormar 0.23.0
- collerek ormar 0.23.0
- ormar Debian 14 0.23.0-1
debian advisories DEBIAN-CVE-2026-26198
Is CVE-2026-26198 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.
Check with FencerCISA SSVC
- Exploitation
- Proof of concept is public
- Automatable
- yes
- Technical impact
- total
- Assessed
- 8mo ago
Exploit prediction
1.01% chance of exploitation in the next 30 days, higher than 63% of all scored CVEs (FIRST EPSS, 2026-11-09).
Exploits and checks
- github.com https://github.com/collerek/ormar/security/advisories/GHSA-xxh2-68g9-8jqr referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| OSV | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | ormar | >=0.9.9, <0.23.0 |
0.23.0 |
Affected products
- collerek ormar
Classification
- Weakness
-
- CWE-89 Improper Neutralization of Special Elements used in an SQL Command
References
-
github.com
/collerek/ormar/commit/a03bae14fe01358d3eaf7e319fcd5db2e4956b16
web, patch
-
github.com
/collerek/ormar/security/advisories/GHSA-xxh2-68g9-8jqr
web, exploit, vendor-advisory
-
github.com
/collerek/ormar/releases/tag/0.23.0
web, product, release-notes
-
nvd.nist.gov
/vuln/detail/CVE-2026-26198
advisory
-
github.com
/collerek/ormar
package
-
pypi.org
/project/ormar
package
-
github.com
/advisories/GHSA-xxh2-68g9-8jqr
advisory
Sources
- CVE List CVE-2026-26198
- GitHub Advisory GHSA-xxh2-68g9-8jqr
- NVD CVE-2026-26198
- OSV PYSEC-2026-439
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.