REDHAT-BUG-2497460: Medium severity Hugo Hugo vulnerability

Published Jul 6, 2026
·
Updated

Hugo is a static site generator. From v0.123.0 through v0.163.0, Hugo's virtual filesystem is designed so that files under a mount cannot reach outside the mount tree, but a regression caused RootMappingFs.statRoot to call Stat, which follows symlinks, instead of Lstat, so a direct os.ReadFile "somefile" where somefile was a symlink pointing outside the mount would return the target's contents. This effectively let a symlink planted inside a theme or local mount read arbitrary files reachable to the user running hugo. This issue is fixed in v0.163.1.

Affected Software

1 affected component
Hugo Hugo>=0.123.0<=0.163.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in v0.163.1

Event History

Jul 6, 2026
Data Sourced
via Red Hat·08:02 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

Who is exposed to this issue?

Users running affected Hugo versions from v0.123.0 through v0.163.0 are exposed when Hugo processes a theme or local mount containing a symlink that points outside its mount tree. The symlink can read files that are reachable by the user account running Hugo.

2

What does an attacker need to exploit it?

An attacker needs to plant a symlink inside a theme or local mount and have Hugo perform a direct os.ReadFile on that symlink. The symlink target must be readable by the account that runs Hugo.

3

Are default Hugo installations affected?

The issue depends on Hugo processing a malicious or untrusted symlink within a theme or local mount; the provided information does not establish that a default installation is affected without such content.

4

What should be done if updating is not immediately possible?

Avoid processing untrusted themes or local mounts, and review mounted content for symlinks that point outside the intended mount tree. Run Hugo with an account that has access only to files required for the build.

5

How can I tell whether my environment is affected?

Check whether the deployed Hugo version is between v0.123.0 and v0.163.0 inclusive, and inspect themes and local mounts for symlinks targeting paths outside their mount trees. The issue is fixed in v0.163.1.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203