GHSA-R48V-R4VW-H9V8: GHSA-r48v-r4vw-h9v8: Arbitrary Build-Host File Disclosure via Path Traversal in Hugo Vendored Module…
GHSA-r48v-r4vw-h9v8: Arbitrary Build-Host File Disclosure via Path Traversal in Hugo Vendored Module Metadata Vulnerability ID: GHSA-R48V-R4VW-H9V8 CVSS Score: 5.5 Published: 2026-12-01 Hugo versions prior to 0.170.
GHSA-r48v-r4vw-h9v8: Arbitrary Build-Host File Disclosure via Path Traversal in Hugo Vendored Module Metadata
Vulnerability ID: GHSA-R48V-R4VW-H9V8
CVSS Score: 5.5
Published: 2026-12-01
Hugo versions prior to 0.170.0 contain a path traversal and improper symlink resolution vulnerability in the module resolution and vendoring subsystem. By supplying relative traversal sequences in _vendor/modules.txt or crafting symbolic links within vendored directory hierarchies, an untrusted third-party theme or Hugo module can bind its module root to an arbitrary directory on the build host. During site compilation, template functions such as readFile can access and render sensitive files from the host filesystem into the generated static output.
TL;DR
A path traversal and symlink following vulnerability in Hugo (< 0.170.0) allows malicious themes or modules to read arbitrary files from the build host filesystem via crafted _vendor/modules.txt metadata and symbolic links, exposing sensitive host data in the compiled website output.
⚠️ Exploit Status: POC
Technical Details
- Advisory ID: GHSA-r48v-r4vw-h9v8
- Weakness Class: CWE-22 (Path Traversal) / CWE-59 (Link Following)
- Attack Vector: Local / Supply Chain (Malicious Hugo Theme or Module)
- CVSS v3.1 Score: 5.5 Medium (CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N)
- Impact: Arbitrary Build-Host File Disclosure
- Affected Versions: Hugo < 0.170.0
- Patched Version: Hugo >= 0.170.0
- Exploit Status: PoC Available (Regression Test Suite)
Affected Systems
- Hugo Static Site Generator (< 0.170.0)
-
Hugo: < 0.170.0 (Fixed in:
0.170.0)
Code Analysis
Commit: d41a8a1
Enforce filepath.IsLocal on vendored module paths and block symlinks in non-project module owner directories
--- a/modules/collect.go
+++ b/modules/collect.go
@@ -332,6 +333,12 @@ func (c *collector) getAndCreateModule(owner *moduleAdapter, moduleImport Import
return nil, nil
}
+ if !moduleImport.pathProjectReplaced {
+ if err := c.checkNoSymlinksInOwnerDir(realOwner, moduleDir); err != nil {
+ return nil, err
+ }
+ }
+
if !strings.HasSuffix(moduleDir, fileSeparator) {
moduleDir += fileSeparator
}
@@ -631,6 +662,10 @@ func (c *collector) collectModulesTXT(owner Module) error {
}
path := parts[0]
+ if !filepath.IsLocal(path) {
+ return fmt.Errorf("invalid module path %q in %q: must be a local path relative to %q", path, filename, vendord)
+ }
+
shouldAdd := c.Client.moduleConfig.VendorClosest
Exploit Details
- GitHub (Hugo Regression Test Suite): Official regression tests included in the fix commit demonstrating path traversal via _vendor/modules.txt and symlink directory traversal to read host files via readFile.
Mitigation Strategies
- Upgrade Hugo binary to version 0.170.0 or later across all developer workstations and CI/CD build agents.
- Audit third-party themes, git submodules, and vendored dependencies for suspicious path traversal strings or symbolic links prior to building.
- Isolate static site generation workloads inside ephemeral, minimal containers devoid of deployment secrets or host filesystem mounts.
Remediation Steps:
- Update the Hugo installation to >= v0.170.0 via official release binaries, Homebrew (
brew upgrade hugo), orgo install github.com/gohugoio/[email protected]. - Update CI/CD pipeline configuration files (e.g., GitHub Actions workflows, Dockerfile base images) to pin the Hugo version to 0.170.0 or newer.
- Inspect existing repositories for any symlinked directories under
themes/or_vendor/usingfind themes/ _vendor/ -type l. - Verify that no
_vendor/modules.txtfile contains..or absolute path declarations.
References
- GitHub Advisory Database: GHSA-r48v-r4vw-h9v8
- Hugo Repository Security Advisory: GHSA-r48v-r4vw-h9v8
- Fix Commit d41a8a196e6b2fd5e5aa886c790d6c679dd73be0
- Hugo Pull Request #15564
- Hugo Release v0.170.0
Read the full report for GHSA-R48V-R4VW-H9V8 on our website for more details including interactive diagrams and full exploit analysis.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.