GHSA-7VCX-MHXQ-9J96
Denial of service via image-transform endpoint accepting unvalidated target dimensions
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Remediación | Parche 12.2.0 | directus · -22 d desde divulgación | |
| Divulgación | Publicada | GHSA-7VCX-MHXQ-9J96 divulgada · CVSS 7.5 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
Denial of service on `GET /assets/<id>` in Directus. The transform-eligibility check in `AssetsService.getAsset`
validates only the source image's stored dimensions against `ASSETS_TRANSFORM_IMAGE_MAX_DIMENSION` (default `6000`). The
user-supplied target dimensions in the `width` and `height` query parameters are passed to Sharp's resize operation with
no equivalent cap, so a tiny source image can be transformed into a very large raster, materialising a gigabyte-scale
RGBA pixel buffer per request.
On deployments that have configured any of the four `directus_settings` branding-image fields (`project_logo`,
`public_background`, `public_foreground`, `public_favicon`), the transform endpoint is reachable by an unauthenticated
attacker, because those fields are exempt from the normal access check and their identifiers are disclosed by the
unauthenticated `/server/info` endpoint. On other deployments, exploitation requires an authenticated account with
`directus_files:read` on at least one image.
Details
The eligibility check compares the source image's stored width and height against `ASSETS_TRANSFORM_IMAGE_MAX_DIMENSION`
and rejects transforms when either source axis exceeds the limit. No equivalent validation is applied to the requested
output dimensions before they reach Sharp, and `withoutEnlargement` is only honoured when the caller explicitly enables
it. As a result, a request for output far larger than the source (for example, a 1x1 source rendered at 20000x20000) is
accepted and allocates a multi-gigabyte pixel buffer before the per-transform timeout (default
`ASSETS_TRANSFORM_TIMEOUT=7500ms`) fires.
`HEAD` requests trigger the full transform while transferring no response body, so the server-side cost is unchanged
while the attacker's bandwidth cost is effectively zero. The concurrent transform queue is bounded by
`ASSETS_TRANSFORM_MAX_CONCURRENT` (default `25`), giving a theoretical worst-case allocation on the order of tens of
gigabytes under sustained load; on under-provisioned hosts the Node process is OOM-killed well before that. There is no
rate limiter on `/assets/*` in the default configuration (`RATE_LIMITER_ENABLED=false`).
Impact
A remote attacker can issue small HTTP requests (including `HEAD`) that each cause the Directus process to allocate
gigabyte-sized image buffers and saturate CPU cores, degrading or denying service for legitimate clients. On deployments
with branding images configured, the attack is unauthenticated; otherwise it requires an authenticated account with
`directus_files:read`. In both cases the impact ceiling is the transform queue size multiplied by the per-transform
buffer size, which on typical hosts is sufficient to exhaust available memory.
Credits
Reported by @chndlrx
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 |
|---|---|---|---|---|
npmdirectus |
Corregida | 12.2.0 | -22 d | 12.6.1 no afectada |
12.2.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-7vcx-mhxq-9j96Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
