CVE-2026-26198

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

HIGH
7.5
CVSS Score
Published: February 24, 2026 at 02:03 AM UTC
Updated: June 17, 2026 at 10:25 AM UTC
1 product affected across 1 vendorOrmar

Using ormar by collerek?

Get instant alerts when new vulnerabilities affect ormar - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH7.5
Exploit prediction
EPSS 1.0%
SSVC
PoC

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.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 0.23.00.9.9 ≤ v < 0.23.0

Fix versions

  • Outside the affected range from 0.23.0
    Our inference from the affected range (< 0.23.0)

Remediation

No guide yet

No remediation guidance has been written for this CVE yet. What the record does show:

References (3)

x_refsource_CONFIRMExploitVendor Advisory
Source: cverecord
https://github.com/collerek/ormar/security/advisories/GHSA-xxh2-68g9-8jqr
x_refsource_MISCProductRelease Notes
Source: cverecord
https://github.com/collerek/ormar/releases/tag/0.23.0

SSVC — Action Prioritization

SSVCPoCAutomatableTotal impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
NETWORK
Complexity
LOW
Privileges
NONE
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
NONE
Availability
NONE
Vector?

Quick Info

StatusANALYZED
CWE
CWE-89

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card

This product uses data from the NVD API but is not endorsed or certified by the NVD. CVE records are from the CVE Program (CVE.org).