{"cve":"CVE-2026-26198","nvd":{"published":"2026-02-24T03:16:01.100","modified":"2026-06-17T10:25:55.673","status":"Analyzed","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.","cvss_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5},"cwes":["CWE-89"],"references":["https://github.com/collerek/ormar/commit/a03bae14fe01358d3eaf7e319fcd5db2e4956b16","https://github.com/collerek/ormar/releases/tag/0.23.0","https://github.com/collerek/ormar/security/advisories/GHSA-xxh2-68g9-8jqr"],"products":["collerek:ormar"],"source":"nvd","synced_at":"2026-10-19T22:24:17.937441719+00:00"},"epss":{"cve":"CVE-2026-26198","score":0.01013,"percentile":0.63239,"date":"2026-10-31"},"kev":null,"osv":[{"id":"GHSA-xxh2-68g9-8jqr","url":"https://osv.dev/vulnerability/GHSA-xxh2-68g9-8jqr","summary":"ormar is vulnerable to SQL Injection through aggregate functions min() and max()","modified":"2026-06-29T12:26:05.129774692Z","packages":[{"ecosystem":"PyPI","name":"ormar","purl":"pkg:pypi/ormar","ranges":[">=0.9.9 <0.23.0"],"fixed":["0.23.0"]}]},{"id":"PYSEC-2026-439","url":"https://osv.dev/vulnerability/PYSEC-2026-439","summary":"ormar is vulnerable to SQL Injection through aggregate functions min() and max()","modified":"2026-07-13T16:15:29.436839418Z","packages":[{"ecosystem":"PyPI","name":"ormar","purl":"pkg:pypi/ormar","ranges":[">=0.9.9 <0.23.0"],"fixed":["0.23.0"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}