REDHAT-BUG-2550056: Path Traversal
Hugo from v0.84.0 before v0.167.0 contains a path traversal vulnerability that allows malicious themes or modules to read files outside the project root via ESBuild's fallback resolver in js.Build, js.Batch, and css.Build. Attackers can ship relative imports or symlinks pointing outside the project to bundle any file readable by the build user into published JavaScript or CSS output.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Hugoto a version that resolves this vulnerability.Fixed in 0.167.0
Event History
Frequently Asked Questions
Who is realistically exposed to this issue?
Users of Hugo versions from v0.84.0 before v0.167.0 are exposed when they build sites using a malicious or untrusted theme or module. The impact depends on files readable by the account running the Hugo build.
What does an attacker need to exploit it?
An attacker needs to supply or influence a Hugo theme or module used by the target build. The malicious content can use relative imports or symlinks that point outside the project root in js.Build, js.Batch, or css.Build processing.
What is the practical impact of a successful exploit?
Files outside the project root that are readable by the build user can be bundled into generated JavaScript or CSS and published with the site. This can expose local build-environment data through the resulting site assets.
How can teams reduce risk if they cannot update immediately?
Avoid building untrusted themes or modules, and review theme and module imports and symlinks for paths that resolve outside the project root. Run builds with an account that has access only to files required for the build, limiting what could be read and included in output.