CVE-2026-140395: Hugo 0.56.0 before 0.170.0 Path Traversal via _vendor/modules.txt

Published Dec 1, 2026
·
Updated

Hugo from 0.56.0 before 0.170.0 contains a path traversal vulnerability that allows malicious themes or modules to read arbitrary build host files by supplying '..' segments in vendor/modules.txt import paths. Attackers can make Hugo treat any directory as a module root and use readFile or static mounts to publish secrets, credentials, and system files in the generated site.

Affected Software

1 affected component
Hugo Hugo>=0.56.0<0.170.0

Event History

Dec 1, 2026
CVE Published
via MITRE·02:29 PM
Data Sourced
via MITRE·02:29 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·03:18 PM
DescriptionSeverityWeakness
Event
via NVD·03:18 PM

Frequently Asked Questions

1

Which Hugo deployments are realistically exposed?

Deployments using Hugo versions from 0.56.0 through versions before 0.170.0 are exposed when they build a malicious theme or module containing crafted import paths in _vendor/modules.txt. The vulnerable build host is the system at risk, not only the generated site.

2

What does an attacker need to exploit this issue?

An attacker needs to cause Hugo to process a malicious theme or module that supplies '..' path segments in _vendor/modules.txt import paths. No authentication, user interaction, or complex attack conditions are indicated.

3

What can a successful exploit expose?

The crafted import paths can cause Hugo to treat arbitrary directories as module roots. The malicious content can then use readFile or static mounts to include secrets, credentials, or system files from the build host in the generated site.

4

What should be done if this affects a build pipeline?

Upgrade Hugo to version 0.170.0 or later. Until then, do not build untrusted themes or modules, and treat generated output from affected builds as potentially containing files from the build host.

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