CVE-2026-58403: Hugo symlink confinement bypass in virtual filesystem

CVE-2026-58403 · Severity: medium · CVSS 4 · Published 2026-07-06

Hugo, a popular tool for building websites, contains a security flaw that could allow unauthorized access to files on a developer's computer. If a user is tricked into using a malicious website theme or plugin containing a specially crafted shortcut (symlink), the tool may inadvertently read and expose sensitive files located outside of the project folder. This could lead to the theft of private data or credentials accessible to the user running the software.

Technologies: github.com/gohugoio/hugo (Go), Hugo. Vendors: Go, Hugo.

Quick answers

Is CVE-2026-58403 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-58403 being exploited in the wild.
How severe is CVE-2026-58403?
Medium severity, with a CVSS score of 4, published 6 July 2026.
Which products and versions are affected?
github.com/gohugoio/hugo (Go) SEMVER:introduced=0.123.0,fixed=0.163.1; Hugo >= 0.123.0, < 0.163.1.
Is there a fix for CVE-2026-58403?
Yes. github.com/gohugoio/hugo (Go): upgrade to 0.163.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-58403 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-58403?
Check whether you run github.com/gohugoio/hugo (Go) or Hugo at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • github.com/gohugoio/hugo (Go): upgrade to 0.163.1 or later
    go get github.com/gohugoio/hugo@v0.163.1

Technical details

A regression in Hugo's virtual filesystem (specifically within RootMappingFs.statRoot) caused the application to use Stat instead of Lstat. Because Stat follows symbolic links, an attacker who can place a malicious symlink within a mounted directory (such as a local theme) can bypass the intended filesystem confinement. When Hugo performs a direct file read on such a symlink, it returns the contents of the target file outside the mount tree. This vulnerability affects versions v0.123.0 through v0.163.0 and is fixed in v0.163.1. Exploitation requires the victim to process a malicious local mount or theme; themes downloaded as Go modules are not affected as symlinks are stripped during download.

Affected products

  • gohugoio Hugo >= 0.123.0, < 0.163.1

Identifiers

  • CVE-2026-58403
  • GHSA-c3wq-j5vh-68rc
  • GO-2026-5309

Timeline

  • 2026-06-10: patched: Fix merged into master branch
  • 2026-06-11: advisory: Release v0.163.1 published
  • 2026-07-06: disclosed: CVE published to NVD

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.