{"answers":{"affected":"3 open source packages ship an affected version, including ormar. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-26198 exists.","fix":"Upgrade ormar to 0.23.0 or later.","what":"CVE-2026-26198 is a critical SQL injection vulnerability in collerek ormar, published on 24 Feb 2026. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2026-26198 and fix it if it is affected.\n\nWhat it is: CVE-2026-26198 is a critical SQL injection vulnerability in collerek ormar, published on 24 Feb 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-26198 exists.\n\nAffected packages and fixed versions:\n- ormar (PyPI): affected from 0.9.9; fixed in 0.23.0\n- ormar (PyPI): affected from 0.9.9; fixed in 0.23.0\n- ormar (PyPI): affected from 0.9.9; fixed in 0.23.0\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2026-26198/ (Markdown: https://insights.sbomify.com/CVE-2026-26198/index.md)","id":"CVE-2026-26198","markdown":"https://insights.sbomify.com/CVE-2026-26198/index.md","name":"CVE-2026-26198","record":{"aliases":["DEBIAN-CVE-2026-26198","GHSA-xxh2-68g9-8jqr","PYSEC-2026-439","UBUNTU-CVE-2026-26198"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_read"],"network_reachable":"yes","non_default_config":false,"product_category":"Python ORM library","requires_auth":"none","summary":"Attackers can inject SQL via min/max aggregate functions to read entire database contents, affecting users of the Ormar Python ORM.","user_interaction":"not_required","vuln_class":"sql_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"ormar","vendor":"collerek"}],"cvss":{"score":9.8,"severity":"critical","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-89","name":"Improper Neutralization of Special Elements used in an SQL Command"}],"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.","ecosystems":["PyPI"],"exploits":{"exploitdb":0,"first_seen":"2026-03-25","github_poc":2,"max_poc_stars":0,"metasploit":0,"nuclei":0,"refs":[{"date":"2026-03-25T13:09:40Z","kind":"github_poc","ref":"https://github.com/sergicortesabadia/CVE-2026-26198-analysis","stars":0,"title":"Deep dive into a critical SQL injection in Python's Ormar ORM — reproduction, fix, and tests"},{"date":"2026-04-19T06:21:44Z","kind":"github_poc","ref":"https://github.com/NetVanguard-cmd/CVE-2026-26198","stars":0,"title":null}],"tier":"weaponised"},"has_fix":true,"headline":"ormar is vulnerable to SQL Injection through aggregate functions min() and max()","id":"CVE-2026-26198","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"sql_injection","year":"2026"},"n_packages":3,"n_references":3,"next":{"headline":"Buffer underflow in `H5Iget_name `/`H5G_get_name` if size is zero","id":"CVE-2026-26199"},"packages":[{"ecosystem":"PyPI","fixed":["0.23.0"],"introduced":["0.9.9"],"last_affected":[],"package":"ormar","purl":null,"source":"GHSA-xxh2-68g9-8jqr"},{"ecosystem":"PyPI","fixed":["0.23.0"],"introduced":["0.9.9"],"last_affected":[],"package":"ormar","purl":"pkg:pypi/ormar","source":"GHSA-xxh2-68g9-8jqr"},{"ecosystem":"PyPI","fixed":["0.23.0"],"introduced":["0.9.9"],"last_affected":[],"package":"ormar","purl":"pkg:pypi/ormar","source":"PYSEC-2026-439"}],"prev":{"headline":"Array full size, element count, and element size are not checked to make sure they match in H5Odtype.c","id":"CVE-2026-26197"},"products":["ormar"],"published":"2026-02-24","related":[{"cvss_score":7.1,"headline":"ormar has a Pydantic Validation Bypass via Kwargs Injection in Model Constructor","id":"CVE-2026-27953","kev_date_added":null,"published":"2026-03-19"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"},{"class":"open","licence":"CC0","name":"PoC-in-GitHub"}],"ssvc":{"automatable":"yes","exploitation":"poc","technical_impact":"total"},"state":"PUBLISHED","updated":"2026-02-24","vendors":["collerek"]},"summary":"Attackers can inject SQL via min/max aggregate functions to read entire database contents, affecting users of the Ormar Python ORM.","url":"https://insights.sbomify.com/CVE-2026-26198/"}