---
title: "CVE-2026-26198: ormar is vulnerable to SQL Injection through aggregate functions min() and max()"
url: https://erroneo.us/security/cve/CVE-2026-26198/
description: "CVE-2026-26198 (ormar (PyPI)): Ormar is a async mini ORM for Python. In versions 0.9.9 through 0.22.0, when performing aggregate queries, Ormar ORM…"
type: vulnerability-record
section: "Security Digest"
date_published: 2026-02-24
date_modified: 2026-02-24
publisher: erroneo.us
author: erroneo.us Security Desk
cve: "CVE-2026-26198"
kev: false
cvss: 9.8
epss: 0.00711
license: All rights reserved. Quote with attribution and a link.
---

# CVE-2026-26198: ormar is vulnerable to SQL Injection through aggregate functions min() and max()

**Signal:** Critical and remotely reachable. No known exploitation yet, but it is network-reachable without credentials. (Computed from CISA KEV, EPSS and CVSS; not an editorial verdict.)

## Should you act?

- Not in CISA KEV , but CISA’s SSVC assessment records a public proof-of-concept, so attack code exists.
- EPSS 0.7% , percentile 53: FIRST’s model estimates a 0.7% chance of exploitation activity in the next 30 days, higher than 53% of all scored CVEs (moderate). EPSS is a probability, not a verdict.
- Remotely reachable with no login and no user interaction. If the vulnerable service is exposed to the internet, prioritize it.
- Only applies if your dependency tree includes ormar (PyPI) >= 0.9.9, <= 0.22.0, fixed in 0.23.0 . Check your lockfile, including transitive dependencies.

## What it is

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 isnumeric 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 packages

- PyPI `ormar` >= 0.9.9, <= 0.22.0 → fixed: 0.23.0

## Affected products (CVE record)

- collerek ormar: >= 0.9.9, < 0.23.0

## Severity

- GitHub_M CVSS 3.1: 9.8 `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- GitHub CVSS 3.1: 9.8 `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`

## Exploitation

- CISA KEV: not listed (no confirmed in-the-wild exploitation known to CISA).
- CISA SSVC assessment: exploitation poc , automatable yes , technical impact total .
- FIRST EPSS (model of 2026-10-21): 0.71% probability of exploitation activity in the next 30 days; percentile 53.

## Sources

- [GitHub Advisory GHSA-xxh2-68g9-8jqr](https://github.com/advisories/GHSA-xxh2-68g9-8jqr)
- [CVE.org record CVE-2026-26198](https://www.cve.org/CVERecord?id=CVE-2026-26198)
- [NVD entry CVE-2026-26198](https://nvd.nist.gov/vuln/detail/CVE-2026-26198)
- [github.com](https://github.com/collerek/ormar/security/advisories/GHSA-xxh2-68g9-8jqr)
- [github.com](https://github.com/collerek/ormar/commit/a03bae14fe01358d3eaf7e319fcd5db2e4956b16)
- [github.com](https://github.com/collerek/ormar/releases/tag/0.23.0)

---
Source page: https://erroneo.us/security/cve/CVE-2026-26198/ · Security Digest: https://erroneo.us/security/ · More: https://erroneo.us/llms.txt
