CVE-2026-26198: Python
CVE-2026-26198
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 `sql...
Overview
A critical security vulnerability has been identified in the Ormar library, a popular asynchronous ORM (Object-Relational Mapper) for Python. This flaw allows an attacker to execute arbitrary SQL commands, potentially leading to a full compromise of the connected database.
Vulnerability Explained Simply
Ormar helps developers interact with databases using Python code instead of raw SQL. In affected versions, two specific functions-min() and max()-fail to properly check the user-supplied column names used in queries. Because these inputs are not validated, an attacker can craft a malicious string that gets interpreted as part of a SQL command. This allows them to inject their own SQL code, effectively bypassing the ORM’s safety controls and interacting directly with the database.
Potential Impact
The impact of this vulnerability is severe. An unauthorized user can exploit it to:
- Read all data from the database, including sensitive information from tables not normally accessible to the application.
- Exfiltrate user credentials, personal data, financial records, or any other stored information.
- Perform data manipulation such as altering or deleting data, depending on database permissions.
Given that exploitation requires no special privileges and can be performed remotely, this vulnerability poses a significant risk to any application using a vulnerable version of Ormar.
Remediation and Mitigation
Immediate action is required to secure affected systems.
Primary Fix: The issue is patched in Ormar version 0.23.0. All users of versions 0.9.9 through 0.22.0 must upgrade immediately.
pip install --upgrade ormar==0.23.0
Temporary Mitigation (If Immediate Upgrade is Not Possible):
If an upgrade cannot be performed instantly, developers must implement strict input validation on any application code that uses the QuerySet.min() or QuerySet.max() methods with user-provided data. Ensure only pre-approved, whitelisted column names are passed to these methods. This is a stopgap measure; upgrading remains the only complete solution.
Verification:
After upgrading, review your codebase for any usage of aggregate functions (min, max, sum, avg) and confirm they are not accepting unsanitized user input. Conduct thorough testing to ensure application functionality remains correct.
Never miss a critical vulnerability
Get real-time security alerts delivered to your preferred platform.
Am I Affected by CVE-2026-26198?
Pick an ecosystem, paste your installed version, and we'll compare it against the fixed version published on OSV.dev. Browser-only — nothing is sent to a server.
Heuristic comparison only. Always cross-check against the vendor advisory before making patching decisions.
Related Advisories
Semantic Kernel, Microsoft's semantic kernel Python SDK, has a remote code execution vulnerability in versions prior to 1.39.4, specifically within the `InMemoryVectorStore` filter functionality. The ...
Crawl4AI versions prior to 0.8.0 contain a remote code execution vulnerability in the Docker API deployment. The /crawl endpoint accepts a hooks parameter containing Python code that is executed using...
pyLoad is a free and open-source download manager written in Python. From version 0.5.0b3.dev13 to 0.5.0b3.dev96, the edit_package() function implements insufficient sanitization for the pack_folder p...
Mesa is an open-source Python library for agent-based modeling, simulating complex systems and exploring emergent behaviors. In version 3.5.0 and prior, checking out of untrusted code in benchmarks.ym...
Other Python Vulnerabilities
pyLoad is a free and open-source download manager written in Python. From version 0.5.0b3.dev13 to 0.5.0b3.dev96, the edit_package() function implements insufficient sanitization for the pack_folder p...
Mesa is an open-source Python library for agent-based modeling, simulating complex systems and exploring emergent behaviors. In version 3.5.0 and prior, checking out of untrusted code in benchmarks.ym...
An issue was discovered in 6.0 before 6.0.3, 5.2 before 5.2.12, and 4.2 before 4.2.29. `URLField.to_python()` in Django calls `urllib.parse.urlsplit()`, which performs NFKC normalization on Windows th...
joserfc is a Python library that provides an implementation of several JSON Object Signing and Encryption (JOSE) standards. In 1.6.2 and earlier, a resource exhaustion vulnerability in joserfc allows ...