Summary
Craft CMS has a SQL injection vulnerability in how certain element-query criteria are handled. An authenticated low-privilege user may be able to inject SQL through nested array parameters, potentially enabling blind database queries and access to database contents.
Affected context
The issue affects Craft CMS deployments in which user-controlled nested array parameters reach Element::findOne() criteria without being safely constrained. Endpoints such as users/delete-address and users/save-address are identified as possible paths; exposure depends on endpoint availability and the permissions required to use them.
Exploit preconditions
- Attack surface: Craft CMS endpoints that pass user-supplied criteria to
Element::findOne() - Required access: An authenticated account with access to a relevant endpoint; the description characterizes this as low privilege
- Trigger point: Processing nested array parameters that can set the query's
whereproperty - Why exploitation is possible: User-controlled values may be interpreted as raw SQL rather than safely constrained query criteria
Why this happens
The underlying bug is insufficient separation between user-controlled input and SQL query structure. When nested criteria can influence a query's where property without safe parameterization or strict validation, an attacker may alter the resulting SQL. This maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command.
Potential impact
- An attacker may infer database information through blind boolean-based or time-based queries.
- Sensitive records could be exposed if they are accessible to the affected queries.
- Database confidentiality and, depending on query behavior and permissions, integrity could be at risk.
General mitigation guidance
Defensive patterns focus on ensuring user input cannot control SQL structure:
- Use parameterized query interfaces and avoid composing SQL from user-controlled criteria.
- Validate criteria against strict schemas and allowlists of supported fields and operators.
- Reject unexpected nested structures and constrain accepted input types and values.
- Apply least-privilege database permissions so application queries have only the access they require.
- Minimize the amount of sensitive data available to endpoints and query paths.
How teams detect issues like this
- Use static analysis to identify query construction that combines request data with SQL structure or passes unchecked criteria to query APIs.
- Review endpoints that accept nested arrays and trace how those values reach
Element::findOne()and itswhereproperty. - Test validation and query-building policies to confirm unsupported fields, operators, and nested input are rejected.
- Monitor for unusual database query timing or patterns that may indicate blind SQL injection, while treating such signals as leads for investigation.

