REDHAT-BUG-2497518: Medium severity Hugo Hugo vulnerability
Hugo is a static site generator. From 0.123.0 to 0.161.1, a regression made RootMappingFs.statRoot use Stat (follows symlinks) instead of Lstat , so a direct resources.Get of a symlink pointing outside its mount returned the target's contents — letting a symlink planted in a local mount (e.g. a vendored themes/ theme) read arbitrary files accessible to the Hugo user. Go-module themes from GitHub (symlinks stripped) and directory walks were unaffected. Fixed in 0.162.0.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 0.162.0
Event History
Frequently Asked Questions
Which Hugo deployments are exposed to this issue?
Deployments using Hugo versions 0.123.0 through 0.161.1 are exposed when they process a local mount containing a planted symlink, such as a vendored theme. Go-module themes obtained from GitHub are not affected because symlinks are stripped.
What must an attacker control to exploit the issue?
An attacker must be able to plant a symlink in a local Hugo mount and have Hugo perform a direct resources.Get on that symlink. The symlink must point to a file outside the mount that is readable by the user running Hugo.
Are normal directory walks affected?
No. The issue affects direct resources.Get access to the symlink; directory walks were unaffected.
What is the remediation?
Upgrade Hugo to version 0.162.0, which contains the fix. If upgrading is not immediately possible, avoid processing untrusted local mounts or vendored themes that may contain symlinks, and ensure the Hugo process has access only to files it needs.