GHSA-W5RH-MHXJ-WR8R
Authenticated DOM XSS via returnUrl in 2FA verification
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-W5RH-MHXJ-WR8R divulgada | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Craft CMS is vulnerable to a DOM-based cross-site scripting issue in the Control Panel login / 2FA verification flow. A user-controlled returnUrl value can be supplied as a `javascript:` URL in the `/admin/login?verify=1` flow. After the victim completes authentication and TOTP verification, the crafted `returnUrl` is executed in the authenticated /admin origin.
Because the payload executes in the victim’s authenticated control panel session, it can perform same-origin privileged actions with the victim’s permissions. In my live validation, I used this to fetch an entry edit form, reuse its CSRF-bearing fields, submit a forged save request, change the entry slug, and disable the entry.
Description
The issue exists in the Control Panel authentication / post-verification flow, where a user-controlled `returnUrl` is later used in client-side navigation logic. In the vulnerable flow, `returnUrl` can be supplied as a `javascript:` URL.
An attacker can therefore send a crafted login URL to a victim. If the victim authenticates and completes the 2FA challenge, attacker-controlled JavaScript executes in the authenticated `/admin` origin.
Prerequisites
In order for this to be exploitable:
- The user has to have 2FA enabled.
- The attacker can get the user to click on their payload-injected login URL after they’ve submitted the password form, and before completing the 2FA method.
Vulnerable code path
During review and live validation, I traced the issue through the following relevant Craft CMS code paths:
- `target/cms-runtime/vendor/craftcms/cms/src/web/assets/login/src/LoginForm.js`
- `target/cms-runtime/vendor/craftcms/cms/src/controllers/UsersController.php`
- `target/cms-runtime/vendor/craftcms/cms/src/templates/_special/login.twig`
The client-side login / verification flow accepts and later uses a user-controlled `returnUrl` value. In the vulnerable flow, an attacker can supply a `javascript:` URL as `returnUrl` in `/admin/login?verify=1`. After the victim completes authentication and the TOTP verification step, the browser executes the attacker-controlled `javascript:` payload in the authenticated `/admin` origin.
The live state-changing impact demonstrated in this report relies on the normal authenticated entry save flow and site-status handling in these additional code paths:
- `target/cms-runtime/vendor/craftcms/cms/src/controllers/EntriesController.php`
- `target/cms-runtime/vendor/craftcms/cms/src/controllers/BaseEntriesController.php`
- `target/cms-runtime/vendor/craftcms/cms/src/base/Element.php`
In the tested runtime, entry status is handled through `enabledForSite[siteId]`, which allowed the payload to submit a forged authenticated save request that both changed the slug and disabled article `18`.
## Impact
This issue allows attacker-controlled JavaScript execution in the Craft CMS Control Panel origin after the victim completes authentication and 2FA using a crafted login URL.
In practice, impact depends on the victim’s privileges, but for any user with control panel access, it can enable unauthorized same-origin actions available to that account. For administrative users, this can include:
Report ID: 1632
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.10.14 | — | — |
5.10.14Arsenal 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-w5rh-mhxj-wr8rLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
