CVE-2026-58403: Hugo Symlink Path Traversal in Virtual Filesystem (v0.163.0 and Earlier)
Hugo, a popular static site generator, has a flaw in how it manages file access within mount boundaries. Versions 0.123.0 through 0.163.0 allow a symlink placed inside a theme or local mount to bypass directory restrictions and read arbitrary files from the server. An attacker who can contribute a malicious theme or alter a mounted directory could exploit this to access sensitive files that the Hugo process can read. The vulnerability requires user interaction—the user must run Hugo—but poses a meaningful confidentiality risk in collaborative or shared hosting environments. This has been patched in v0.163.1.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 6.5 MEDIUM · CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N
- Weaknesses (CWE)
- CWE-59
- Affected products
- 1 configuration(s)
- Published / Modified
- 2026-07-06 / 2026-07-08
NVD description (verbatim)
Hugo is a static site generator. From v0.123.0 through v0.163.0, Hugo's virtual filesystem is designed so that files under a mount cannot reach outside the mount tree, but a regression caused RootMappingFs.statRoot to call Stat, which follows symlinks, instead of Lstat, so a direct os.ReadFile "somefile" where somefile was a symlink pointing outside the mount would return the target's contents. This effectively let a symlink planted inside a theme or local mount read arbitrary files reachable to the user running hugo. This issue is fixed in v0.163.1.
4 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
The vulnerability stems from a regression in RootMappingFs.statRoot, which changed from using Lstat (which does not follow symlinks) to Stat (which does). Hugo's virtual filesystem is intended to isolate content under a mount so that it cannot traverse outside its boundaries. By following symlinks, the Stat call allows an attacker to craft a symlink inside a mounted directory—such as a theme—that points to an arbitrary file outside the mount. A subsequent os.ReadFile call on that symlink would return the target file's contents, circumventing the isolation mechanism. This affects how Hugo processes themes and local mounts during site generation.
Business impact
In environments where multiple users or third parties contribute themes or content to Hugo projects, this vulnerability allows unauthorized disclosure of sensitive files. Development teams using shared Hugo instances, plugin repositories, or community themes are at risk if a malicious actor injects a symlink-based payload. Exposed files could include environment configuration, API keys, private data files, or other secrets accessible to the user running Hugo. For enterprises using Hugo in CI/CD pipelines or collaborative platforms, compromise of such files could lead to lateral movement or exposure of deployment credentials.
Affected systems
Hugo versions 0.123.0 through 0.163.0 are affected. Systems running these versions that process untrusted themes, mount points from external sources, or allow user-contributed content are at risk. The vulnerability does not affect versions prior to 0.123.0 or v0.163.1 and later. Organizations should audit their deployed Hugo versions and any automated build pipelines that invoke Hugo.
Exploitability
The attack requires an attacker to place a symlink inside a Hugo mount or theme directory—either by directly committing to a repository, uploading to a shared theme location, or by modifying a local mount. Since the vulnerability also requires that a user or automated process run Hugo, the barrier to exploitation is moderate. The CVSS score of 6.5 (Medium) reflects that the attack is network-adjacent, requires no authentication, but does require user interaction. In CI/CD scenarios where Hugo runs automatically on repository changes, a pull request with a malicious theme could trigger the exploit with minimal user awareness.
Remediation
Upgrade Hugo to v0.163.1 or later immediately. Organizations should prioritize this patch in their update cycles given the ease with which a malicious theme can be injected into a build pipeline. For teams unable to patch immediately, restrict the sources from which themes and mounts are allowed, audit existing themes for suspicious symlinks, and limit file system permissions of the Hugo process to only necessary directories.
Patch guidance
Download and install Hugo v0.163.1 or a later stable release from the official Hugo releases page. Verify the version after installation by running `hugo version`. If Hugo is deployed in a container or CI/CD environment, update the base image or pin the new version in your build configuration. Test patched versions in a staging environment before production rollout to ensure compatibility with existing themes and site configuration.
Detection guidance
Monitor Hugo build logs for errors or unexpected file access patterns. In source control, scan commits for new symlinks introduced into theme directories or mount points, especially those pointing outside the repository structure. Runtime detection can be achieved through file access monitoring (auditing os.ReadFile calls on symlinks) or by reviewing Hugo's verbose output with `--debug` flags. In CI/CD pipelines, integrate static analysis tools to flag symlinks in checked-in themes or content directories.
Why prioritize this
While the CVSS score is Medium, the simplicity of exploitation—a single malicious symlink in a theme—combined with the potential to leak high-value credentials in build environments warrants prioritization. Organizations with automated builds, multi-user Hugo projects, or those consuming community themes should patch urgently. The vulnerability does not require sophisticated skills to exploit, and the blast radius in CI/CD contexts is significant.
Risk score, explained
The CVSS 3.1 score of 6.5 reflects a high confidentiality impact (C:H) in a network-accessible scenario with low attack complexity (AC:L) and no special privileges required (PR:N), but tempered by the requirement for user interaction (UI:R) and lack of integrity or availability impact. In tightly controlled environments where themes come only from trusted sources, the practical risk is lower; in open-contribution or community-driven setups, the risk approaches the upper bound of Medium severity.
Frequently asked questions
Do I need to upgrade immediately if I am not using community themes?
No, but upgrade should still be timely. If your Hugo setup uses only internal, trusted themes and mounts, and those are version-controlled with code review, your risk is reduced. However, supply chain attacks can introduce symlinks indirectly—for example, through a compromised dependency. Prioritize patching if your themes or mounts come from external sources or if your Hugo process runs with broad file system permissions.
Can I work around this without patching?
Partial mitigation is possible by auditing themes and mounts for symlinks (use `find /path/to/theme -type l` on Unix), restricting the Hugo process to a minimal file system (using containers or sandboxing), and enforcing code review before theme updates. However, these are not substitutes for patching, especially in automated environments where detection may lag.
Does this affect statically generated sites published on the web?
No. The vulnerability only affects the Hugo build process on the machine running Hugo. Once the site is generated and the static files are published, there is no residual risk to end users visiting the site. The exposure is limited to the build environment and the operator's file system.
What if Hugo is running in a container?
Containerization provides some isolation but is not a complete mitigation. If the container has access to host volumes or secrets (common in CI/CD), a malicious theme can still read those. Patch the Hugo version in the container image and follow principle of least privilege for volume mounts.
This analysis is provided for informational purposes. Verify all patch versions and affected product lines against official vendor advisories before deployment. CVSS scores and KEV status reflect data current as of publication. Security posture is context-dependent; organizations should conduct their own risk assessment based on their infrastructure, data sensitivity, and threat model. No exploit code or weaponized proof-of-concept is provided or endorsed. Source: NVD (public-domain), retrieved 2026-08-15. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2026-50135MEDIUMHugo Symlink Traversal Allows Arbitrary File Read (CVSS 5.5)
- CVE-2025-46293MEDIUMmacOS Symlink Traversal Allows Unauthorized Data Access
- CVE-2026-11322MEDIUMHermes WebUI Path Traversal Vulnerability – Credential Exposure Risk
- CVE-2026-11853MEDIUMDebusine Arbitrary Symlink Creation via Manifest Path Traversal
- CVE-2026-14361MEDIUMPath Traversal in Consul-Template writeToFile
- CVE-2026-14904MEDIUMAWS RES Symbolic Link Vulnerability Allows Arbitrary File Read as Root
- CVE-2026-28262MEDIUMDell iDRAC Tools Symlink Follow Information Tampering Vulnerability
- CVE-2026-39243MEDIUMdecompress Arbitrary Hardlink Creation Vulnerability