GHSA-MJJ9-PJH4-R48G
Unauthenticated SQL injection via GraphQL eager-load "select" criteria
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-MJJ9-PJH4-R48G divulgada | |
| Divulgación | Modificada | Última actualización del registro | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
An anonymous GraphQL request can inject arbitrary SQL expressions into an element query’s `SELECT` clause. Arguments hung off an eager-loadable node that is absent from the active public schema are copied into `EagerLoadPlan::$criteria` and written onto the eager-loaded query with `Craft::configure()`, without passing through any of Craft’s criteria cleansing. A `select` value containing a parenthesis is emitted into the SQL verbatim by Yii’s query builder, so it is evaluated by the database.
This reaches the same criteria path as GHSA-9c4j-cjw3-r3xx, but it is not that issue and is not fixed by it. That advisory’s fix types `EagerLoadPlan::$when` as `?Closure`, which closes the callable sink. The `select` injection does not involve `$when` at all: it needs no nested `with`, no callback, and no `system()`.
Preconditions
- The public GraphQL schema is enabled and grants anonymous read access to at least one section or one asset volume, but not to user groups.
- At least one entry with an author, or one asset with a populated `uploaderId`.
The schema shape is the ordinary least-privilege configuration for a headless frontend that publishes content without publishing user records. It is materially more common than the asset-volume-only configuration required by the earlier eager-load report: an entries-only public schema is the default shape of a Craft headless install.
Granting the schema user-group read access removes the exposure, because `uploader`/`author` are then published as real fields with fixed argument definitions, and the injected `select` argument is rejected as unknown.
The GHSA-9c4j-cjw3-r3xx fix in 5.10.13 types `EagerLoadPlan::$when` as `?Closure`. That prevents a string from being stored on the callable property, which closes both routes into that sink.
It does not affect this issue. The injection here is in `$plan->criteria`, applied by `Craft::configure()` before any callback is considered, and the exploit sends no `with` argument at all.
Impact
An unauthenticated attacker can read arbitrary data from the Craft database, including user email addresses and password hashes, session and verification tokens, and any content stored in the database, regardless of GraphQL schema scope. The schema restrictions the operator configured provide no protection because the injected SQL runs beneath the schema layer.
Report ID: 1819
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 | 4.18.9, 5.11.2 | — | — |
4.18.95.11.2Arsenal 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-mjj9-pjh4-r48gLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
