GHSA-X3MX-CM49-8M9C
Arbitrary file read via symlinks bypassing the Node.js permission model in css.PostCSS and other Node.js tools
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-X3MX-CM49-8M9C divulgada | |
| Remediación | Parche v0.166.0 | github.com/gohugoio/hugo · 0 d desde divulgación | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
Hugo runs Node.js tools (`css.PostCSS`, `css.TailwindCSS`, `js.Babel`) with the Node.js permission model, restricting file system reads to the project directory and configured mounts. Node.js checks the lexical path only and follows symbolic links even when they point outside the allowed set. A symlink committed to the project tree therefore let a PostCSS plugin, or any other Node.js code the project runs, read arbitrary files the Hugo process could read.
Impact
Affected: v0.161.0 to v0.165.0. Before v0.161.0 there was no sandbox at all, so a PostCSS plugin could read any file directly without needing a symlink.
An attacker who can contribute content to a Hugo project (e.g. via a pull request) can commit a symlink such as `assets/css/x.css -> /etc/passwd` and a PostCSS plugin that reads it, exposing files and secrets available to the build environment. The contents can be embedded in the published site.
This affects builds with the default security configuration. It does not affect projects that do not invoke Node.js tools.
Patches
Fixed in v0.166.0. Before a Node.js tool is invoked, Hugo now scans the allowed paths and fails the build if any symbolic link resolves to a target outside them. Relative links inside the tree, such as those in `node_modules/.bin`, are unaffected. A legitimate link can be permitted by adding its target to `security.node.permissions.allowRead`.
Workarounds
Do not build untrusted projects that use Node.js tools, or set `security.exec.allow` so that `node` is not permitted.
References
- https://nodejs.org/api/permissions.html#limitations-and-known-issues
- https://gohugo.io/configuration/security/
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
gogithub.com/gohugoio/hugo |
Corregida | v0.166.0 | 0 d | v0.170.0 no afectada |
v0.166.0Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/gohugoio/hugo/security/advisories/GHSA-x3mx-cm49-8m9cLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
