Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-26198: CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') in collerek ormar

0
Critical
VulnerabilityCVE-2026-26198cvecve-2026-26198cwe-89
Published: Tue Feb 24 2026 (02/24/2026, 02:03:47 UTC)
Source: CVE Database V5
Vendor/Project: collerek
Product: ormar

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.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 03/04/2026, 01:54:24 UTC

Technical Analysis

Ormar is an asynchronous Python ORM designed to simplify database interactions. In versions 0.9.9 through 0.22.0, a critical SQL injection vulnerability (CVE-2026-26198) exists in the implementation of aggregate query methods, specifically min() and max(). These methods accept a column name parameter as a string, which is directly passed into SQLAlchemy's text() function without any validation or sanitization. Unlike sum() and avg(), which perform partial type checks to ensure numeric fields, min() and max() skip these checks entirely. This design flaw enables an attacker to supply malicious SQL code as the column parameter, which is then embedded verbatim into the SQL query. Consequently, an unauthorized attacker can execute arbitrary SQL subqueries, allowing them to read data from any table in the database, not limited to the model being queried. The vulnerability requires no authentication or user interaction and can be exploited remotely if the application exposes the vulnerable query functionality. The flaw impacts confidentiality, integrity, and availability of data. The Ormar project addressed this issue in version 0.23.0 by implementing proper input validation and sanitization to prevent injection. No known exploits have been reported in the wild as of the publication date, but the critical CVSS 3.1 score of 9.8 reflects the high risk posed by this vulnerability.

Potential Impact

The impact of CVE-2026-26198 is severe for organizations using affected versions of Ormar in their Python applications. Exploitation allows attackers to perform unauthorized SQL injection attacks that can lead to full database disclosure, including sensitive information across unrelated tables. This compromises data confidentiality and can lead to data integrity issues if attackers modify queries or data. The vulnerability also threatens availability if attackers execute destructive SQL commands or cause database errors. Since the flaw requires no authentication or user interaction, any exposed application endpoint using vulnerable Ormar versions is at risk. Organizations handling sensitive or regulated data (e.g., personal, financial, healthcare) face significant compliance and reputational risks. The widespread use of Python and ORMs in web applications means many organizations globally could be affected, especially those using async Python stacks with Ormar. The absence of known exploits does not diminish the urgency due to the ease of exploitation and critical severity.

Mitigation Recommendations

To mitigate this vulnerability, organizations should immediately upgrade Ormar to version 0.23.0 or later, where the issue is patched. Until upgrading, avoid using the min() and max() aggregate methods with user-supplied input. Implement strict input validation and sanitization on any parameters that influence database queries, especially those passed to aggregate functions. Employ parameterized queries and avoid constructing SQL statements with raw user input. Conduct a thorough code audit to identify any usage of vulnerable Ormar versions and review query construction patterns. Additionally, implement database access controls and least privilege principles to limit the damage potential if exploitation occurs. Monitor application logs for unusual query patterns indicative of injection attempts. Consider deploying Web Application Firewalls (WAFs) with rules targeting SQL injection payloads as an additional layer of defense. Finally, educate developers on secure coding practices related to ORM usage and SQL injection prevention.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-02-11T19:56:24.813Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 699d14d6be58cf853b182c29

Added to database: 2/24/2026, 3:02:46 AM

Last enriched: 3/4/2026, 1:54:24 AM

Last updated: 4/10/2026, 9:02:48 AM

Views: 147

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses