GHSA-788P-CVGF-Q973
Stored cross-site scripting via unsanitized project color in the generated favicon
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 |
|---|---|---|---|
| Remediación | Parche 12.1.0 | directus · -35 d desde divulgación | |
| Divulgación | Publicada | GHSA-788P-CVGF-Q973 divulgada · CVSS 5.4 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Description
Summary
The Directus app builds a fallback favicon from the configured project color by interpolating that color into an SVG
markup string and assigning the result to `innerHTML`. Because the value is never escaped or validated as a color, a
crafted project color breaks out of the SVG context and injects arbitrary HTML, which executes script in the origin of
the Directus application when a browser loads the app.
Details
`generateFavicon` (`app/src/utils/generate-favicon.ts`) accepted the project color as a string, embedded it in an SVG
`<style>` declaration, and parsed the resulting markup by assigning it to the `innerHTML` of a `<div>`. No HTML or CSS
escaping was applied at any point on that path.
The value passed in is `project_color` from the `directus_settings` singleton, surfaced to the app through the
`/server/info` endpoint. Any principal permitted to update `directus_settings` can therefore persist an arbitrary string
into this sink. In the default configuration that is the administrator role; the exposure that matters is a non-admin
policy that has been granted update access to `directus_settings`, which turns settings write access into script
execution in an administrator's session.
Two properties broaden the reach of the payload:
- The element the markup is parsed into is never attached to the document, but that does not prevent execution. Markup
- `/server/info` is a public endpoint and the favicon is computed by the app's root component, so the payload fires for
Impact
Stored cross-site scripting in the Directus application. A user with permission to write project settings can persist a
payload that executes for every subsequent visitor to the Directus URL, including administrators, enabling session or
token theft and API actions performed with the victim's privileges. Where settings write access has been delegated to a
non-administrative policy, this constitutes privilege escalation to administrator.
Note that administrators already hold documented code-execution capability in Directus through Flows, extensions, and
custom CSS, so an administrator-only exploitation path does not cross a trust boundary on its own.
Patches
Fixed in Directus 12.1.0. The favicon is now assembled with SVG DOM APIs and the color is set as an attribute value, so
it cannot escape into markup.
Workarounds
Restrict update access on `directus_settings` to trusted administrators, and confirm that `project_color` holds a valid
color value.
References
- CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Credits
Reported by @PhilipPhil
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.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-788p-cvgf-q973Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
