GHSA-FC8P-659H-3959
Stored cross-site scripting via HTML uploads permitted by Curator's default accepted file types
Texto original en inglés · Ver en español
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-FC8P-659H-3959 divulgada · CVSS 5.4 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
Curator's upload components fell back to a default list of accepted file types that
included `text/html` and other types that render as documents. An authenticated user
with permission to upload media could upload an HTML file containing a `<script>` tag.
The file was stored unmodified and later served from the application's own origin,
executing the script with the session of whoever opened it.
Impact
Stored cross-site scripting. Because the payload runs in the application's origin, an
attacker with only upload permission (for example a content editor) could target a more
privileged user — typically to steal an admin session.
Exploitation requires an authenticated account that is already permitted to upload
media. It is not exploitable by anonymous visitors.
All four upload entry points were affected, since they share the same default:
- the Media resource create/edit form
- `MultiUploadAction` (bulk upload)
- `CuratorPicker`
- the rich editor's `AttachCuratorMediaPlugin` attachment flow
Applications that already set `acceptedFileTypes()` themselves — globally via
`Curator::acceptedFileTypes()` or per field — were never affected, because the
vulnerable list was only used as a fallback.
Details
`Awcodes\Curator\Concerns\CanUploadFiles::getAcceptedFileTypes()` returned
`MimeType::toArray()` when no explicit list was configured. That enum is a general
catalogue of MIME types and included `text/html`, `application/xhtml+xml`,
`text/javascript`, `application/xml` and `application/octet-stream`, among others.
`acceptedFileTypes()` compiles to a Laravel `mimetypes:` rule, which validates against
the server-detected MIME type. A genuine HTML file therefore passed validation without
any bypass. Curator sanitizes SVG uploads, but no other type, so the file was written to
disk verbatim and served back with `Content-Type: text/html`.
`application/octet-stream` compounded this: it is what `finfo` reports for anything it
cannot classify, so its presence in the list effectively made the allow list a wildcard.
Patches
Fixed in 4.1.5 and 5.1.5.
The default is now `MimeType::defaults()`, which is the full list minus types that are
effectively executable content: `text/html`, `application/xhtml+xml`, `text/javascript`,
`application/xml`, `application/vnd.mozilla.xul+xml`, `application/x-httpd-php`,
`application/x-sh`, `application/x-csh`, `application/x-shockwave-flash` and
`application/octet-stream`.
As defense in depth, media served through Curator's own route is now sent with
`X-Content-Type-Options: nosniff`, and restricted types are forced to
`Content-Disposition: attachment`.
`MimeType::toArray()` is unchanged, so code referencing the enum directly still works.
Workarounds
Set the accepted types explicitly, either globally or per field:
Curator::acceptedFileTypes(['image/jpeg', 'image/png', 'image/webp', 'application/pdf']);
Note for applications that opt these types back in
Curator only sanitizes SVG uploads; any other type you allow is stored and served
verbatim. The response headers added in this release apply only to Curator's own media
route. With the default `public` disk, files are also reachable directly through the
`storage` symlink, where those headers do not apply. Serve deliberately-allowed
executable types from a private disk.
Not affected
The 3.x line is not affected. It reads its accepted types from
`config('curator.accepted_file_types')`, whose default has always been limited to
`image/jpeg`, `image/png`, `image/webp`, `image/svg+xml` and `application/pdf`.
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 | 4.1.5, 5.1.5 | — | — |
4.1.55.1.5Arsenal 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-fc8p-659h-3959Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
