GHSA-CPHX-CX67-JCQJ
Authenticated SQL injection via "Element::findOne()" array criteria
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-CPHX-CX67-JCQJ divulgada | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Craft CMS’s `Element::findOne()` accepts a criteria array. Several controllers pass a user-controlled request parameter straight into it without an integer cast or sanitization. By supplying the parameter as a nested array, an attacker can set the query object’s public `where` property to `['AND', '<raw SQL>']`. Yii’s query builder treats string operands as raw SQL, so arbitrary SQL is injected into the `WHERE` clause. A lowest-privilege (zero-permission) account is enough to blind-read the database.
Preconditions
- An authenticated account.
- If the site has public registration enabled (`users.allowPublicRegistration = true`). Note that the attacker can self-register.
- The target `addresses` table must contain at least one row for the time-based oracle to fire reliably (otherwise the MySQL optimizer may short-circuit the `WHERE`).
Affected Endpoints
- `POST /index.php?p=actions/users/delete-address` — any logged-in user, no permission required (used in the PoC)
- `POST /index.php?p=actions/users/save-address` — any logged-in user, no permission required
- `GET/POST /index.php?p=actions/assets/preview-thumb` — requires `accessCp`
- `GET/POST /index.php?p=actions/assets/show-in-folder` — requires `accessCp`
The injection runs before the ownership/permission checks (`getOwnerId()`, `canSave()`, `canDelete()`), so it works even against addresses the attacker does not own.
Note: the same class of SQLi was fixed in 5.11.2 (GHSA-mjj9-pjh4-r48g) for the eager-loading path via `cleanseQueryCriteria()`; this `findOne()` path was missed.
Impact
A single authenticated account is enough to read the database. The injection lands in `SELECT ... WHERE`; using blind boolean/time-based injection can read database contents, including any sensitive data.
Report ID: 2057
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Packagistcraftcms/cms |
Corregida | 5.11.5 | — | — |
5.11.5Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/craftcms/cms/security/advisories/GHSA-cphx-cx67-jcqjLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
