GHSA-8QMJ-6MJ5-55PM
Stored XSS via Untrusted Client Filename Extension in Attachment Disk Name
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-8QMJ-6MJ5-55PM divulgada · CVSS 5.4 (GitHub) | |
| Divulgación | Modificada | Última actualización del registro | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
`October\Rain\Database\Attach\File::getDiskName()` preserved the file extension from the uploaded file's `getClientOriginalName()` verbatim, and every downstream consumer (URL builders, thumbnail generators, backend list/preview partials) concatenated the resulting `disk_name` into HTML attributes and URLs without encoding. A crafted upload with a filename such as `avatar.x" onerror="document.title=1337` produced a `disk_name` containing literal quote characters, which broke out of any `src="..."` attribute a downstream renderer emitted.
The reporter demonstrated the chain against a RainLab.User avatar upload: an anonymous frontend visitor could create an account, upload a valid PNG with the crafted client filename, and script would execute in the backend origin the next time an administrator opened that user's record in the backend list preview.
Impact
- Stored XSS reachable from an unauthenticated or minimally authenticated frontend user wherever the framework's file attachment surface is exposed to public uploads (frontend account avatars, contact form attachments, submission blueprints, etc.)
- Payload triggers whenever any backend user opens a page that renders the attachment URL through a template that concatenates it into HTML without escaping
- Impact bounded by the victim admin's permissions; a super-user opening the affected record exposes the full backend session
Patches
The vulnerability has been patched in v3.7.17 and v4.3.5. `File::getDiskName()` now sanitizes the derived extension to alphanumerics only before appending it to the stored disk name, so quote characters, angle brackets, spaces, and other attribute-breaking bytes can no longer reach downstream renderers via the client filename.
Note: theme and plugin authors who render attachment URLs in their own partials should still escape URL values at the sink; the framework fix closes the specific "filename smuggles HTML metacharacters into disk_name" primitive but is not a substitute for escaping at output.
Workarounds
If upgrading immediately is not possible:
- Audit backend and theme partials that render file attachment URLs and wrap the URL in `e()` (PHP partials) or rely on Twig's autoescape (Twig templates)
- Disable frontend upload paths (RainLab.User avatars, unauthenticated form attachments) until the framework is upgraded
References
- Reported by CodingRule
- Credit: Elure (Marasescu Mihnea-Luca) with the help of pentest-tools.com
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Packagistoctober/rain |
Sin parche | — | — | — |
Arsenal 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-8qmj-6mj5-55pmLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
