MediumGHSA-x597-9fr4-5857CVE-2026-44301GO-2026-5740

Hugo's Node tool execution allows file system access outside the project directory

Published 6 May 2026 · Updated 24 Jul 2026

Is your project on an affected github.com/gohugoio/hugo?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several Go apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Affected package

Affected
>=0.43.0 <0.161.0
Fixed in
0.161.0
Update to the fixed version for your release line, for example:go get github.com/gohugoio/hugo@v0.161.0

Details

Impact

When building a Hugo site that uses Node-based asset pipelines (PostCSS, Babel, TailwindCSS), Hugo invoked the configured Node tools without restrictions on file system access. As a result, executing hugo against an untrusted site could allow code running through these tools to read or write files outside the project's working directory.

Users who do not use PostCSS, Babel, or TailwindCSS, or who only build trusted sites, are not affected.

Patches

From v0.161.0, Hugo runs Node tools under Node's permission model with strict defaults: No write access and only read access to the site source directories and files.

Workarounds

Block these tools in security.exec.allow.

Is GHSA-x597-9fr4-5857 in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected github.com/gohugoio/hugo, and gives you the command that fixes it.

More advisories for github.com/gohugoio/hugo

  • LowCVE-2026-58403Hugo: Symlink confinement bypass in os.ReadFile in github.com/gohugoio/hugo · 24 Jul 2026
  • LowCVE-2026-58402Hugo: XSS via unescaped code-fence language in default code block renderer in github.com/gohugoio/hugo · 24 Jul 2026
  • LowCVE-2026-58404Hugo: security.http.urls deny rules bypassed by alternate IPv4 encodings (SSRF) in github.com/gohugoio/hugo · 24 Jul 2026
  • LowCVE-2026-50133Hugo: XSS via text/html content files in github.com/gohugoio/hugo · 7 Jul 2026
  • LowCVE-2026-50135Hugo: Symlink confinement bypass in resources.Get in github.com/gohugoio/hugo · 7 Jul 2026
  • LowCVE-2026-35166Hugo: Certain markdown links are not properly escaped in github.com/gohugoio/hugo · 7 Jul 2026
All 20 advisories for github.com/gohugoio/hugo

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.