GHSA-3VG7-526J-4XJ4
Stored XSS via client-supplied file extensions
Texto original en inglés · Ver en español
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-3VG7-526J-4XJ4 divulgada · CVSS 8.7 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
Curator validates uploads by their detected content type but stores them with the extension from the client's filename, lowercased and otherwise unchanged. Default configuration is affected. Exploiting it needs an account that can upload media.
This also gets around the fixes for GHSA-fc8p-659h-3959 and GHSA-3xm3-q2fj-x8rq.
Details
- HTML served from the application origin. A file whose content is detected as an accepted image type but whose name ends in `.html` passes validation. It's stored with an `.html` extension, and the web server serves the direct storage URL as `text/html` from the application's origin. Script in the file runs for anyone who opens that URL.
- Script injection in the media edit page. The stored extension is part of the media's `path` and `url`. The "Copy URL" control in the media details view interpolates `url` into an inline JavaScript string without JavaScript escaping. A crafted filename extension therefore runs script in the panel when a user, typically an administrator, clicks "Copy URL" on that media's edit page. This doesn't require `preserveFilenames`.
The import helper (`CuratorUtils::importMedia`) takes the extension the same way.
*Score:* `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N` (8.7)
Affected versions
Confirmed at runtime on 5.5.0 and 3.7.11. 4.2.1 was checked against the 5.x code paths, which are the same, and the fixes were tested on every line.
All 5.x, 4.x and 3.x releases are affected.
- 3.x: the stored extension isn't lowercased either.
- `CuratorUtils::importMedia`: this applies only to 5.x and 4.x.
Patches
Upgrade to 5.5.2, 4.2.2 or 3.7.12.
What the fix does
- Detected types: Curator now detects an upload's type from the file's own bytes and stores the file under that type's extension.
- Exact matching: scriptable types (HTML, XML, JavaScript and similar) are accepted only when listed exactly, never through a wildcard.
- SVG sanitizing: SVGs are sanitized before anything is written to disk, and an SVG that can't be sanitized is rejected.
- Escaping: values rendered into JavaScript in the views are encoded.
If you upgraded to 5.5.1
5.5.1 fixed the stored extension but took the upload's type from Livewire. On S3 temporary uploads with Livewire 3 before 3.8.6 or Livewire 4 before 4.4.2, that type is the one the browser declared. 5.5.1 also wrote an SVG to disk before sanitizing it, so a document the sanitizer rejected was left on disk. 5.5.2 closes both. Upgrade from 5.5.1 as well.
Remediation for existing media
After upgrading, check stored media for files with an unsafe extension, then repair them:
php artisan curator:repair-extensions --dry-run # report only
php artisan curator:repair-extensionsThe command renames files whose stored extension is unsafe. That includes HTML left behind by uploads accepted before GHSA-fc8p-659h-3959 was fixed, which is renamed to `.txt`. Each rename is printed as `old -> new`. A renamed file's URL changes, so copies of the old link need updating.
Workarounds
Restrict uploads to trusted users. Serve the media disk with `Content-Disposition: attachment` or from a separate origin, and audit existing `media.ext` values for anything other than the expected image or document extensions.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Packagistawcodes/filament-curator |
Corregida | 3.7.12, 4.2.2, 5.5.2 | — | — |
3.7.124.2.25.5.2Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/awcodes/filament-curator/security/advisories/GHSA-3vg7-526j-4xj4Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
