# GHSA-r73q-gwx2-fpxm: Hugo theme-defined module replacements bypass mount restrictions and widen the Node.js read sandbox

- Severity: Medium (CVSS:4.0, scored by GitHub) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2026-11-30T21:49:32.000Z
- Modified: 2026-11-30T22:00:05.264Z
- Weaknesses: CWE-863

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

(As written by GitHub Advisory Database.)

## Affected

- github.com/gohugoio/hugo (Go): from 0.152.0 before 0.168.0

## References

- <https://github.com/gohugoio/hugo/security/advisories/GHSA-r73q-gwx2-fpxm> (web)
- <https://github.com/gohugoio/hugo/pull/15426> (web)
- <https://github.com/gohugoio/hugo/commit/6883b55ad59e0daa1aaba0cf2b66db1132202e2c> (web)
- <https://github.com/gohugoio/hugo> (package)
- <https://github.com/gohugoio/hugo/releases/tag/v0.168.0> (web)

## Sources

- GitHub Advisory Database: [GHSA-r73q-gwx2-fpxm](https://github.com/advisories/GHSA-r73q-gwx2-fpxm), CC-BY-4.0, modified 2026-11-30

---

Page: https://cve.day/GHSA-r73q-gwx2-fpxm · Whole record: https://cve.day/GHSA-r73q-gwx2-fpxm.json · Rebuilt by cve.day 2026-11-30T22:07:24.979Z
