Dev.to Security 🔐 Cybersecurity 👁 2 📖 3 min read

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:

  1. Update the Hugo installation to >= v0.170.0 via official release binaries, Homebrew (brew upgrade hugo), or go install github.com/gohugoio/[email protected].
  2. 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.
  3. Inspect existing repositories for any symlinked directories under themes/ or _vendor/ using find themes/ _vendor/ -type l.
  4. Verify that no _vendor/modules.txt file contains .. or absolute path declarations.

References

Read the full report for GHSA-R48V-R4VW-H9V8 on our website for more details including interactive diagrams and full exploit analysis.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.