{"id":"GHSA-r73q-gwx2-fpxm","aliases":[],"url":"https://o3.security/vulnerability/GHSA-r73q-gwx2-fpxm","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.","published":"2026-11-30T21:49:32Z","modified":"2026-11-30T22:00:05.264106052Z","cvss":null,"epss":null,"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"Go","name":"github.com/gohugoio/hugo","fixedVersion":"0.168.0"}],"fix":{"url":"https://github.com/gohugoio/hugo/pull/15426","label":"gohugoio/hugo#15426"},"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"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-11-30T22:00:05.264106052Z"}}