Skip to content

github.com/gohugoio/hugo

Hugo theme-defined module replacements bypass mount restrictions and widen the Node.js read sandbox

GHSA-r73q-gwx2-fpxmPublished 30 Nov 2026, 21:49 UTC

Real-world risk

2.4/ 10Low

Routine

PreliminaryFrom the CVSS vector only · confidence low

CVSS

6.7

scored by GitHub, CVSS 4.0

In plain words

No plain-language summary yet. The original description is below.

Original description

### 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.

Am I affected?

ProductAffected versions (from the sources)Fixed in
github.com/gohugoio/hugoNiche>= 0.152.0, < 0.168.00.168.0

What to do

Update to a fixed version: 0.168.0.

Why this score

FactorValueEvidence×
ImpactMajor data exposureReads secrets, credentials, databases, arbitrary filesFrom the CVSS vector0.80
Attacker positionLocalMust already run code or have a shell on the machineFrom the CVSS vector0.50
Privileges neededNoneNo accountFrom the CVSS vector1.00
Victim interactionRoutineA normal action: open a file, visit a page, click a linkFrom the CVSS vector0.70
ConfigurationDefaultOut-of-the-box installs are vulnerableFrom the CVSS vector1.00
ReliabilityReliableDeterministic: injection, logic bug, path traversalFrom the CVSS vector1.00

Threat level T1: Nothing known (× 0.85)

The default for a new disclosure

The arithmetic
  1. Prerequisites multiplied together0.350
  2. Threat T1: Nothing known0.850
  3. 10 × impact 0.8 × prerequisites 0.35 × threat 0.852.380
  4. Rounded to one decimal between 0.1 and 102.4

How the score works

Exploitation and evidence timeline

  1. 30 Nov 2026 Published
  2. 2 Dec 2026 Risk 2.4 (cvss fallback)

Weakness

CWE-863

References

Get alerts for github.com/gohugoio/hugo

Free email or text alerts when a vulnerability in github.com/gohugoio/hugo reaches risk 8 or higher. Nothing else.