REDHAT-BUG-2541815: Medium severity Hugo Hugo vulnerability
Hugo versions from v0.161.0 through v0.165.0 run Node.js tools (css.PostCSS, css.TailwindCSS, js.Babel) under the Node.js permission model to restrict file system reads to the project directory and configured mounts. Because the Node.js permission model validates only the lexical path and follows symbolic links that point outside the allowed set, Hugo did not detect symlinks escaping the sandbox. An attacker who can contribute content to a Hugo project (for example via a pull request) can commit a symlink such as assets/css/x.css -> /etc/passwd together with a PostCSS plugin that reads it, allowing any file readable by the Hugo build process to be disclosed and potentially embedded in the published site. This affects builds using the default security configuration; projects that do not invoke Node.js tools are unaffected. Fixed in v0.166.0, which scans allowed paths and fails the build when a symbolic link resolves outside them.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Hugoto a version that resolves this vulnerability.Fixed in v0.166.0
Event History
Frequently Asked Questions
Which Hugo builds are exposed?
Hugo versions v0.161.0 through v0.165.0 are affected when the build invokes Node.js tools such as css.PostCSS, css.TailwindCSS, or js.Babel. Projects that do not invoke these tools are unaffected.
What access does an attacker need to exploit this?
An attacker needs the ability to contribute content to the Hugo project, such as through a pull request. They can add a symbolic link to a readable file outside the project and a PostCSS plugin that reads it during the build.
Are default settings affected?
Yes. Builds using Hugo's default security configuration are affected when they run the relevant Node.js tools.
What is the impact if exploitation succeeds?
Files readable by the Hugo build process can be disclosed and may be embedded in the published site. The disclosure is enabled by a symlink that resolves outside the project directory or configured mounts.
What remediation is available?
Upgrade to Hugo v0.166.0. This version scans allowed paths and fails the build when a symbolic link resolves outside them.