GHSA-5R92-75J8-C534
Authenticated RCE through signed-cookie/redirect confusion
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-5R92-75J8-C534 divulgada | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Craft signs an authenticated user’s attacker-controlled license-shun cookie with the same key and format used to validate signed `redirect` parameters. The cookie envelope can therefore be transplanted into `redirect`.
On a successful login, Craft validates the signature and renders the authenticated bytes as unsandboxed Twig, allowing PHP `system()` to execute an arbitrary command. A non-administrator account is sufficient; access to the Control Panel is not required.
Preconditions
- A valid Craft account using password authentication and without active 2FA.
- The account can access the live site, or has `accessSiteWhenSystemIsOff` while the system is offline.
- The default request configuration is used, so `cookieValidationKey` and signed request parameters use Craft’s `securityKey`.
- PHP `system()` and the server's `sh` and `base64` commands are available.
Root cause
`AppController::actionSetLicenseShunCookie()` copies the required `hash` body parameter into a response cookie and requires authentication but no administrator permission (`src/controllers/AppController.php:50-95,456-473`). Yii signs the serialized cookie as `HMAC || data` (`vendor/yiisoft/yii2/web/Response.php:389-414`; `vendor/yiisoft/yii2/base/Security.php:348-391`). Craft configures Yii’s `cookieValidationKey` from the global `securityKey`, which is also the default key used by `Security::validateData()` (`src/helpers/App.php:1280-1290`; `src/services/Security.php:97-128`). The signature is not bound to its purpose.
After a valid login, `UsersController` returns the User through `asModelSuccess()` (`src/controllers/UsersController.php:228-305,2592-2614`). That path validates `redirect`, then passes the authenticated bytes to `renderObjectTemplate()` (`src/web/Request.php:1013-1027`; `src/web/Controller.php:452-456,655-661`). This renderer uses unsandboxed Twig despite a separate sandboxed method being available (`src/web/View.php:750-825,857-864`). Twig’s `map` filter accepts a string callback outside sandbox mode, so `map('system')` invokes PHP `system()` (`vendor/twig/twig/src/Extension/CoreExtension.php:2024-2037,2108-2119`).
Impact
An authenticated low-privilege attacker can execute arbitrary operating-system commands as the PHP/web-server user, exposing application secrets and data and permitting modification of writable files or service disruption.
Report ID: 1590
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Packagistcraftcms/cms |
Corregida | 4.18.6, 5.10.13 | — | — |
4.18.65.10.13Arsenal 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-5r92-75j8-c534Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
