GHSA-r73q-gwx2-fpxm: Github.com/gohugoio/hugo Hugo Theme-defined Module Replacements Bypass Vulnerability

MODERATE
CWE-863
Published
Advisory Summary

GHSA-r73q-gwx2-fpxm is a MODERATE hugo theme-defined module replacements bypass vulnerability (CWE-863: Incorrect Authorization) affecting Github.com/gohugoio/hugo libraries in the Go ecosystem. The issue involves hugo theme-defined module replacements bypass mount restrictions and widen the node.js read sandbox. Remediation is available by upgrading affected packages to version 0.168.0.

GHSA-r73q-gwx2-fpxm at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-r73q-gwx2-fpxm
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-863: Incorrect Authorization
Affected Product Github.com/gohugoio/hugo
Package Ecosystem Go
Published Date
Last Updated

How to Fix GHSA-r73q-gwx2-fpxm

To remediate this vulnerability, upgrade all affected Github.com/gohugoio/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.168.0
Upgrade github.com/gohugoio/hugo to 0.168.0
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-r73q-gwx2-fpxm, inspect your project dependencies for Github.com/gohugoio/hugo:

inspect dependencies for github.com/gohugoio/hugo

Analyze the terminal output to locate any version of Github.com/gohugoio/hugo in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.168.0), 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-863: Incorrect Authorization, where the product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. In Github.com/gohugoio/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

### Summary A theme or module could define its own `module.replacements` and mount directories anywhere on the host. ### Details A theme or module could define its own `module.replacements`. If the project didn't set any replacements, Hugo applied the theme's replacements as if the project had set them. The theme could then import and mount a directory anywhere on the host, either by absolute path or by escaping `themesDir` with `../`. This got around the rule that theme mount sources must be local paths. Mounting such a directory as `assets` also added it to the Node.js `--allow-fs-read` roots. That widened the `security.node.permissions` sandbox. For example, Node tools such as `css.PostCSS` could read files from that directory and load JavaScript modules from it. Only sites that use an untrusted theme or module are affected. ### Proof of concept Create a theme as outlined in the Go test below: ```go func TestMountRestrictThemeReplacements(t *testing.T) { files := ` -- hugo.toml -- disableKinds = ["taxonomy", "term", "rss"] theme = "mytheme" -- themes/mytheme/hugo.toml -- [module] replacements = "evil -> ../../secret" [[module.imports]] path = "evil" [[module.imports.mounts]] source = "." target = "assets" -- secret/file1.txt -- file1 -- layouts/all.html -- All. ` b, err := hugolib.TestE(t, files) b.Assert(err, qt.IsNotNil) b.Assert(err.Error(), qt.Contains, `module "evil" not found in "/themes/evil"`) } ``` ### Impact A theme could read files outside its sandbox.

GHSA-r73q-gwx2-fpxm Affected Github.com/gohugoio/hugo Versions

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

References

Frequently Asked Questions

What is GHSA-r73q-gwx2-fpxm?
GHSA-r73q-gwx2-fpxm is a security vulnerability in Github.com/gohugoio/hugo involving Hugo theme-defined module replacements bypass mount restrictions and widen the Node.js read sandbox under CWE-863: Incorrect Authorization.
Which Github.com/gohugoio/hugo versions are affected?
Affected versions include releases prior to 0.168.0 across affected packages: github.com/gohugoio/hugo.
What version fixes GHSA-r73q-gwx2-fpxm?
Upgrading to 0.168.0 (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.168.0. Upgrade your dependency to 0.168.0 or later.
What CWE is associated with GHSA-r73q-gwx2-fpxm?
GHSA-r73q-gwx2-fpxm is classified under CWE-863: Incorrect Authorization (The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check.).
How can I check Go dependencies for GHSA-r73q-gwx2-fpxm?
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-r73q-gwx2-fpxm",
  "modified" : "2026-11-30T21:49:32Z",
  "published" : "2026-11-30T21:49:32Z",
  "aliases" : [ ],
  "summary" : "Hugo theme-defined module replacements bypass mount restrictions and widen the Node.js read sandbox",
  "details" : "### Summary\n\nA theme or module could define its own `module.replacements` and mount directories anywhere on the host.\n\n### Details\n\nA theme or module could define its own `module.replacements`. If the project didn't set any replacements, Hugo applied the theme's replacements as if the project had set them. The theme could then import and mount a directory anywhere on the host, either by absolute path or by escaping `themesDir` with `../`. This got around the rule that theme mount sources must be local paths.\n\nMounting such a directory as `assets` also added it to the Node.js `--allow-fs-read` roots. That widened the `security.node.permissions` sandbox. For example, Node tools such as `css.PostCSS` could read files from that directory and load JavaScript modules from it.\n\nOnly sites that use an untrusted theme or module are affected.\n\n### Proof of concept\n\nCreate a theme as outlined in the Go test below:\n\n```go\nfunc TestMountRestrictThemeReplacements(t *testing.T) {\n    files := `\n-- hugo.toml --\ndisableKinds = [\"taxonomy\", \"term\", \"rss\"]\ntheme = \"mytheme\"\n-- themes/mytheme/hugo.toml --\n[module]\nreplacements = \"evil -> ../../secret\"\n[[module.imports]]\npath = \"evil\"\n[[module.imports.mounts]]\nsource = \".\"\ntarget = \"assets\"\n-- secret/file1.txt --\nfile1\n-- layouts/all.html --\nAll.\n`\n    b, err := hugolib.TestE(t, files)\n    b.Assert(err, qt.IsNotNil)\n    b.Assert(err.Error(), qt.Contains, `module \"evil\" not found in \"/themes/evil\"`)\n}\n```\n\n### Impact\n\nA theme could read files outside its sandbox.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/gohugoio/hugo"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.152.0"
      }, {
        "fixed" : "0.168.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/gohugoio/hugo/security/advisories/GHSA-r73q-gwx2-fpxm"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gohugoio/hugo/pull/15426"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gohugoio/hugo/commit/6883b55ad59e0daa1aaba0cf2b66db1132202e2c"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/gohugoio/hugo"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gohugoio/hugo/releases/tag/v0.168.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-863" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-11-30T21:49:32Z",
    "nvd_published_at" : null
  }
}