GHSA-r73q-gwx2-fpxm

Suggest an improvement
Source
https://github.com/advisories/GHSA-r73q-gwx2-fpxm
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-r73q-gwx2-fpxm/GHSA-r73q-gwx2-fpxm.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-r73q-gwx2-fpxm
Published
2026-11-30T21:49:32Z
Modified
2026-11-30T22:00:05Z
Severity
  • 6.7 (Medium) CVSS_V4 - 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 CVSS Calculator
Summary
Hugo theme-defined module replacements bypass mount restrictions and widen the Node.js read sandbox
Details

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:

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.

Database specific
{
    "cwe_ids":  [
        "CWE-863"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-11-30T21:49:32Z",
    "nvd_published_at":  null,
    "severity":  "MODERATE"
}
References

Affected packages

Go / github.com/gohugoio/hugo

Package

Name
github.com/gohugoio/hugo
View open source insights on deps.dev
Purl
pkg:golang/github.com/gohugoio/hugo

Affected ranges

Type
SEMVER
Events
Introduced
0.152.0
Fixed
0.168.0

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-r73q-gwx2-fpxm/GHSA-r73q-gwx2-fpxm.json"