Skip to main content

Ormar CVE-2026-26198

CRITICAL
SQL Injection (CWE-89)
2026-02-24 security-advisories@github.com GHSA-xxh2-68g9-8jqr
9.8
CVSS 3.1 · GitHub Advisory
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft malicious column name parameter
  2. Exploit
    Pass to min()/max() QuerySet methods
  3. Execution
    Inject SQL into sqlalchemy.text()
  4. Impact
    Execute arbitrary SQL commands

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Parameterized queries, prepared statements
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Persistence

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Ormar ORM versions 0.9.9 through 0.22.0 with min() or max() aggregate query methods called with unsanitized user input. No authentication required; default installations vulnerable to remote SQL injection via application endpoints accepting column parameters.

Impact

CVSS 9.8. ORM-level SQL injection is particularly dangerous because developers trust the ORM to handle SQL safety.

Exploit ScenarioDerived

Attacker sends crafted input that reaches an Ormar aggregate query, injecting SQL that bypasses the ORM's parameterization and directly manipulates the database.

Act Now Prioritize within 24-48h. Why: CRITICAL severity + public POC available.
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Mar 12, 2026

SQL injection in Ormar async ORM for Python versions 0.9.9 through 0.22.0. Aggregate queries pass unsanitized input to SQL, enabling database compromise through the ORM abstraction. PoC and patch available.

Earlier versions of this analysis (1)
v1 Mar 12, 2026 - 21:55 CVSS 9.8

SQL injection through aggregate queries in Ormar Python ORM.

RemediationAI

Update Ormar beyond 0.22.0. Review all aggregate query usage for user-controlled inputs.

Affected Packages

pypi ormar fix: 0.23.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

CWE-89 SQL injection in ORM aggregate functions. The ORM fails to properly parameterize inputs in aggregate query construction, bypassing the ORM's intended SQL safety.

Know when Ormar gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

GitHub Advisory PRIMARY 9.8 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Primary rating from GitHub Advisory · only source for this CVE.

CVSS VectorGitHub Advisory

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

3
PoC Detected
Feb 25, 2026 - 19:41 vuln.today
Public exploit code
Patch released
Feb 25, 2026 - 19:41 nvd
Patch available
CVE Published
Feb 24, 2026 - 03:16 nvd
CRITICAL 9.8

DescriptionGitHub Advisory

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.

Executive ViewAI

Why It Matters

Ormar ORM versions 0.9.9 through 0.22.0 contain a critical SQL injection vulnerability in aggregate query functions that allows unauthenticated attackers to execute arbitrary SQL commands and compromise databases. Any organization using affected Ormar versions in production applications faces immediate risk of data theft, manipulation, or system compromise.

Business Impact: Severe
Compensating Controls

Apply vendor patch. If immediate patching is not possible: (1) Disable aggregate query functionality at the application layer, (2) Implement database-level query monitoring and alerting for suspicious SQL patterns, (3) Restrict database user permissions to minimum required privileges, (4) Deploy WAF rules to detect SQL injection attempts in application inputs, (5) Segment affected systems from critical assets.

Threat Intelligence Overview

EPSS Score
0.0%
Top 88% exploitable
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
Data Quality
4 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC Yes
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity + public POC available
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Out-of-Cycle
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
Very High

Priority Score

69
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +49
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Affected Products (CPE)GitHub Advisory

cpe:2.3:a:collerek:ormar:*:*:*:*:*:python:*:*

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy