GHSA-5F36-P2F5-RC5W
Stored XSS in Mail Template Preview via Unsandboxed Iframe
CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:L/I:L/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-5F36-P2F5-RC5W divulgada · CVSS 3.5 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
The Preview tab in the Mail Templates and Mail Layouts editors renders the template's HTML content inside an `<iframe>` using the `srcdoc` attribute, and the iframe was created without a `sandbox` attribute in `modules/system/assets/js/pages/mailformpreview.js`. Because an unsandboxed `srcdoc` document inherits the parent page's origin, any `<script>` in the rendered mail template executed inside the backend origin with full access to `window.parent`, cookies, and the CSRF token.
A backend user holding only the `mail.templates` permission could save a template containing arbitrary JavaScript. When any other backend user (including a super-administrator) opened that template, the Preview tab loaded automatically and the payload executed in the victim's session. From there the payload could read the CSRF token from the parent DOM and issue same-origin authenticated requests, including creating a new super-user account.
Impact
- Stored XSS in the backend admin panel; payload persists in the `system_mail_templates` table
- Privilege escalation from `mail.templates` to full super-user via same-origin session riding
- No unauthenticated exposure; requires a backend account with `mail.templates` and a victim opening the malicious template
- Regression introduced with the Mail Template preview feature in v4.3.4; only affects v4.3.4
Patches
The vulnerability has been patched in v4.3.5. The preview iframe now sets `sandbox=""`, which loads the rendered HTML into an opaque origin with scripting disabled.
Workarounds
If upgrading immediately is not possible:
- Restrict the `mail.templates` permission to fully trusted administrators
- Or comment out the `$this->addJs('/modules/system/assets/js/pages/mailformpreview.js');` line in `modules/system/controllers/MailTemplates.php::update()` and the equivalent line in `MailLayouts.php` to disable the preview widget
References
- Reported by toanln-cov
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Packagistoctober/system |
Corregida | 4.3.4 | — | — |
4.3.4Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/octobercms/october/security/advisories/GHSA-5f36-p2f5-rc5wLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
