GHSA-5H38-6755-G83W
Path traversal in the Mail Service template engine allows arbitrary host file disclosure
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/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-5H38-6755-G83W divulgada · CVSS 6.8 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Description
Summary
The Directus Mail Service resolves email template names without confirming that the resolved path stays inside the
configured templates directory. An authenticated user who can configure a Flow "Send Email" operation can supply a
relative template name that traverses outside the templates root, causing the Liquid engine to load and render an
arbitrary file from the host filesystem. Combined with the ability to place a file with an attacker-controlled name and
location, this becomes a Local File Inclusion primitive that discloses sensitive host files.
This is most impactful in multi-tenant or managed-hosting deployments, where a tenant-level administrator is expected to
operate only within the application boundary and has no legitimate access to the underlying host filesystem.
Details
`MailService.renderTemplate` builds the template path by joining the caller-supplied `template` value onto the templates
directory with `path.resolve`. Because `path.resolve` collapses `../` segments, a relative value such as
`../../some/other/location/file` resolves to a path outside the intended templates root, and no check rejected paths
that escaped that root. The Liquid engine then reads and renders whichever file the path points to and returns the
rendered output in the email body.
The `template` value is reachable by any user who can create or edit a Flow mail operation (the operation's `template`
option flows directly into the render call). To make the resolved path land on a file the engine will load, an attacker
pairs this with control over a stored file's on-disk name and location; that file-placement issue is tracked separately
under GHSA-xjxq-pj7h-g676. Once a suitable file exists, the traversal in the mail service turns it into readable output,
and Liquid include directives within a rendered template can pull in further host files.
Impact
- Host file disclosure from an application context. A user restricted to application features can read files outside
- Secret exposure and downstream escalation. Disclosure of the application secret and database credentials can
- Weakened tenant isolation. In shared-hosting or SaaS deployments, a tenant administrator can reach files belonging
The vulnerability requires an authenticated account with administrative capabilities (managing Flows and files), so it
is primarily an authority-boundary and tenant-isolation issue rather than an unauthenticated exposure.
Credits
Reported by @drkim-dev
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-5h38-6755-g83wLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
