Read the docs
TI-2026-21189 Aliases CVE-2026-26198GHSA-xxh2-68g9-8jqr

ormar is vulnerable to SQL Injection through aggregate functions min() and max()

Priority HIGH 82CWE-89Published · Updated

Key facts

Attack vector
Network
Privileges required
None
User interaction
None
Attack complexity
Low
Impact type
SQL injection
Confidentiality · integrity · availability
High · High · High
Fix status
Fixed

Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-89.

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.

Why it matters now

Exploitation Proof of concept CISA SSVC · not in CISA KEV
EPSS 0.01013 63rd percentileScored 2026-11-07
Public exploit Yes 1 exploit referenceTagged by NVD
Fix Fixed ormar (collerek): 0.23.0ormar (PyPI): 0.23.0

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
Poc
Automatable
Yes
Technical impact
Total

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
collerekormar0.9.9 to before 0.23.00.23.0Patch availableCNA
—ormar (PyPI)0.9.9 to before 0.23.00.23.0Patch availableGHSA-xxh2-68g9-8jqr
  • ormar Vendorcollerek Affected 0.9.9 to before 0.23.0 Fixed in 0.23.0 Patch available CNA
  • ormar (PyPI) Vendor— Affected 0.9.9 to before 0.23.0 Fixed in 0.23.0 Patch available GHSA-xxh2-68g9-8jqr

CPE configurations NVD · 1

CPEVersionsRoleVendor
cpe:2.3:a:collerek:ormar:*:*:*:*:*:python:*:*0.9.9 to before 0.23.0Vulnerablecollerek
  • cpe:2.3:a:collerek:ormar:*:*:*:*:*:python:*:* Versions 0.9.9 to before 0.23.0 Vulnerable ·collerek

Remediation

  • Fix · CNA ormar (collerek) Fixed in 0.23.0
  • Fix · GHSA-xxh2-68g9-8jqr ormar (PyPI) Fixed in 0.23.0 Advisory →

Timeline

  1. 2026-10-02 Threatist record created from CVE-2026-26198
  2. 2026-10-03 Alias added: GHSA-xxh2-68g9-8jqr

References

  • TI-2026-22297 ormar has a Pydantic Validation Bypass via Kwargs Injection in Model Constructor CVSS 3.1CRITICAL 9.8

Sources