llamaCVEVulnerability Intelligence
/
Advisory · GitHub · Go · github.com/gohugoio/hugo

GHSA-R48V-R4VW-H9V8

Path traversal via `_vendor/modules.txt` lets themes/modules read arbitrary files on the build host

Parche disponible
Descargar PNG JSON
CVSS
—
medium
Fuente: —
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche1 versiónPrimer parche el mismo día de la divulgación
Exposición6 dDesde la divulgación, 13 nov 2026, 11:12 a. m.
Detección5 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Parche v0.170.0
Monitoreo
Detectada +1
13 nov 26
18 nov 26
19 nov 26
13 nov 26
15 nov 26
16 nov 26
18 nov 26
19 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-R48V-R4VW-H9V8 divulgada
Remediación Parche v0.170.0 github.com/gohugoio/hugo · 0 d desde divulgación
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés
Summary

A theme or module can ship a `_vendor/modules.txt` with an import path containing `..` segments. Hugo used this path as the module's root directory without checking that it stays inside `_vendor`, so a malicious theme can make Hugo treat any directory on the build host (up to `/`) as its module root and read files from it.

Details

`collectModulesTXT` in `modules/collect.go` builds the vendored module directory with `filepath.Join(vendorDir, path)`, where `path` comes straight from `_vendor/modules.txt`. When an import resolves through the vendor list, Hugo uses that directory as is and skips the checks that normally keep a theme under `themesDir`. The resulting root is added to Hugo's filesystem overlay, which makes files outside the project available to `readFile`, `resources.Get`, `os.ReadFile` and mounts (e.g. a `static` mount that publishes the directory).

The fix rejects any `modules.txt` path that is not local (`filepath.IsLocal`), so the build fails with an `invalid module path` error.

Proof of concept

A site uses an untrusted theme (`theme = "evil"`). The theme imports `../../../..` and lists the same path in its `_vendor/modules.txt`. A template then calls `readFile` on a path relative to the escaped root, e.g. a file outside the project or a system file such as `etc/passwd`. Its content ends up in the generated site.

Impact

Anyone building a site with an untrusted theme or module, for example in CI or on a hosted build service, can have files on the build host read and published in the site. This includes secrets, credentials and system files. No change to the site configuration beyond importing the theme is needed.

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

Versiones

Rangos afectados

Afectada Corregida Última
github.com/gohugoio/hugo≥ v0.56.0 < v0.170.0
v0.56.0
v0.170.0
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
gogithub.com/gohugoio/hugo
Corregida v0.170.0 0 d v0.170.0 no afectada
Versiones corregidasv0.170.0
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/gohugoio/hugo/security/advisories/GHSA-r48v-r4vw-h9v8

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.