GHSA-c3wq-j5vh-68rc: Hugo Symlink Confinement Bypass Vulnerability

MODERATE
CWE-59
Published
Advisory Summary

GHSA-c3wq-j5vh-68rc is a MODERATE symlink confinement bypass vulnerability (CWE-59: Improper Link Resolution Before File Access ('Link Following')) affecting Hugo libraries in the Go ecosystem. The issue involves symlink confinement bypass in os.readfile. Remediation is available by upgrading affected packages to version 0.163.1.

GHSA-c3wq-j5vh-68rc at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-c3wq-j5vh-68rc
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-59: Improper Link Resolution Before File Access ('Link Following')
Affected Product Hugo
Package Ecosystem Go
Published Date
Last Updated

How to Fix GHSA-c3wq-j5vh-68rc

To remediate this vulnerability, upgrade all affected Hugo dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/gohugoio/hugo fixed: 0.163.1
Upgrade github.com/gohugoio/hugo to 0.163.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/gohugoio/hugo

How to Check if You Are Affected

To determine whether your application is affected by GHSA-c3wq-j5vh-68rc, inspect your project dependencies for Hugo:

inspect dependencies for github.com/gohugoio/hugo

Analyze the terminal output to locate any version of Hugo in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.163.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-59: Improper Link Resolution Before File Access ('Link Following'), where the product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. In Hugo, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

**Affected versions:** v0.123.0 through v0.163.0. Earlier versions are not affected. **Fixed in:** v0.163.1. **Severity:** Medium. Requires the attacker to be able to place (or convince a site author to place) a symlink inside a mounted directory — for example, inside a locally-vendored theme under `themes/`. Themes mounted as Go modules from GitHub have symlinks stripped on download and are not affected. Multi-directory walks (e.g. content/asset walking) were not affected either; only direct lookups via `resources.Get` followed symlinks. **Description.** Hugo's virtual filesystem is designed so that files under a mount cannot reach outside the mount tree. A regression introduced in v0.123.0 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`.

GHSA-c3wq-j5vh-68rc Affected Hugo Versions

1 component(s)
Fixed Versions:
0.163.1
Product / Package Ecosystem Affected Versions Fixed Version
github.com/gohugoio/hugo
Go
≥ 0.123.0
< 0.163.1
0.163.1

References

Frequently Asked Questions

What is GHSA-c3wq-j5vh-68rc?
GHSA-c3wq-j5vh-68rc is a security vulnerability in Hugo involving Symlink confinement bypass in os.ReadFile under CWE-59: Improper Link Resolution Before File Access ('Link Following').
Which Hugo versions are affected?
Affected versions include releases prior to 0.163.1 across affected packages: github.com/gohugoio/hugo.
What version fixes GHSA-c3wq-j5vh-68rc?
Upgrading to 0.163.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/gohugoio/hugo affected?
Yes, github.com/gohugoio/hugo is affected in releases prior to 0.163.1. Upgrade your dependency to 0.163.1 or later.
What CWE is associated with GHSA-c3wq-j5vh-68rc?
GHSA-c3wq-j5vh-68rc is classified under CWE-59: Improper Link Resolution Before File Access ('Link Following') (The product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.).
How can I check Go dependencies for GHSA-c3wq-j5vh-68rc?
Run the dependency tree command: 'inspect dependencies for github.com/gohugoio/hugo'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-c3wq-j5vh-68rc",
  "modified" : "2026-06-19T17:45:38Z",
  "published" : "2026-06-19T17:45:38Z",
  "aliases" : [ ],
  "summary" : "Hugo: Symlink confinement bypass in os.ReadFile",
  "details" : "**Affected versions:** v0.123.0 through v0.163.0. Earlier versions are not affected.\n**Fixed in:** v0.163.1.\n**Severity:** Medium. Requires the attacker to be able to place (or convince a site author to place) a symlink inside a mounted directory — for example, inside a locally-vendored theme under `themes/`. Themes mounted as Go modules from GitHub have symlinks stripped on download and are not affected. Multi-directory walks (e.g. content/asset walking) were not affected either; only direct lookups via `resources.Get` followed symlinks.\n\n**Description.** Hugo's virtual filesystem is designed so that files under a mount cannot reach outside the mount tree. A regression introduced in v0.123.0 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`.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:N/SC:H/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/gohugoio/hugo"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.123.0"
      }, {
        "fixed" : "0.163.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/gohugoio/hugo/security/advisories/GHSA-c3wq-j5vh-68rc"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/gohugoio/hugo"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-59" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-19T17:45:38Z",
    "nvd_published_at" : null
  }
}