{"id":"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 -\u003e ../../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.","modified":"2026-11-30T22:00:05.264106052Z","published":"2026-11-30T21:49:32Z","database_specific":{"severity":"MODERATE","github_reviewed":true,"github_reviewed_at":"2026-11-30T21:49:32Z","nvd_published_at":null,"cwe_ids":["CWE-863"]},"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"}],"affected":[{"package":{"name":"github.com/gohugoio/hugo","ecosystem":"Go","purl":"pkg:golang/github.com/gohugoio/hugo"},"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"}}],"schema_version":"1.9.2","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"}]}