GHSA-3742-46GX-C8CC
Improper path validation in TUS uploads allows writing to arbitrary storage paths
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Remediación | Parche 12.1.0 | directus · -35 d desde divulgación | |
| Divulgación | Publicada | GHSA-3742-46GX-C8CC divulgada · CVSS 7.1 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
The TUS (resumable upload) implementation creates the `directus_files` record through the generic `ItemsService` rather
than through `FilesService`. The `filename_disk` sanitisation and validation that `FilesService` applies on the regular
upload path is therefore skipped, and the `filename_disk` value supplied by the client in the TUS `Upload-Metadata`
header is passed verbatim to the storage driver as the destination path.
An authenticated user who is permitted to create files can consequently choose the storage path their upload is written
to, place uploads outside the configured storage root prefix, and overwrite the stored content of existing file records.
Impact
The concrete effect depends on the storage driver in use:
- Local driver. The supplied path is joined onto the storage root after leading traversal segments are dropped, so
- Object storage drivers (S3 and equivalents). The supplied path is joined onto the configured root prefix without
In both cases no uniqueness check is performed on `filename_disk`, so an upload can be pointed at the disk name of an
existing file record. The bytes served for that unrelated record are then replaced with attacker controlled content.
Where the deployment places the extensions directory or the temporary directory inside the storage root, or serves
extensions from the same storage location used for uploads, this write primitive reaches a location whose contents are
loaded and executed by the server. That escalation is configuration dependent and is not reachable in a default
deployment.
Preconditions
- TUS uploads enabled (`TUS_ENABLED`, which defaults to `false`).
- An authenticated account holding create permission on `directus_files`. No administrative access is required.
Workarounds
- Leave TUS uploads disabled (`TUS_ENABLED=false`, the default).
- Restrict create permission on `directus_files` to trusted roles.
- Keep the extensions and temporary directories outside the storage root, and do not share a storage bucket between
Credit
Reported by @oduoke567
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
npmdirectus |
Corregida | 12.1.0 | -35 d | 12.6.1 no afectada |
12.1.0Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/directus/directus/security/advisories/GHSA-3742-46gx-c8ccLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
