AI security incident: ormar is vulnerable to SQL Injection through aggregate functions min() and max() (GHS...
Report of SQL Injection Vulnerability in Ormar ORM ## A SQL Injection attack can be achieved by passing a crafted string to the min() or max() aggregate functions. ## Brief description 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.
Why This Is AI-Related
This advisory is part of the public incident archive, but the current source material uses limited explicit AI terminology, so the cited sources should be reviewed carefully when judging AI relevance and exposure.
- Explicit AI-specific signals are limited in the current source material, so use the cited advisory to validate scope during triage.
Affected Workflow
Review the AI product, dependency, and integration points mentioned in the source advisory before broadening remediation.
Likely Attack Path
The advisory indicates a security path that can affect AI applications, assistants, models, or connected automation workflows if the component is deployed.
Impact
The advisory has meaningful security implications for an AI-related product, dependency, or workflow and should be triaged against deployed usage. Severity HIGH. Classification confidence 78%. Source channel GHSA.
Detection And Triage Signals
- New security events tied to the affected component or advisory identifier
- Changes in AI workflow behavior, access logs, or plugin execution after the advisory window
- Evidence that the vulnerable version is active in environments that process sensitive data
Recommended Response
- Confirm whether affected products, models, or integrations are used in your environment.
- Apply vendor fixes or mitigations and restrict risky permissions until verified.
- Monitor logs for related indicators and document containment for audit evidence.
Compliance And Business Impact
Even when exploit details are still emerging, delayed triage can widen operational and compliance exposure around AI systems.
Sources
Want alerts like this in real time?
Get notified with incident context, likely impact, and response guidance.
Get Notified