Skip to main content
VulnerabilityPublished

github.com/gohugoio/hugo · Hugo: Build-host file disclosure through path traversal in vendored module metadata

Affects github.com/gohugoio/hugoSource GCVE Database

0

CVSS 6.7 Medium : upgrade to 0.170.0 when convenient.

Data as of 1 Dec 2026, 04:17 UTC

CVSS 4.0 base score
6.7Medium
How severe the flaw is on the 0–10 CVSS scale.
Patch
Available – fixed in 0.170.0
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N

What to do

Upgrade github.com/gohugoio/hugo to 0.170.0.

Affected software

ProductAffectedFixed in
Gogithub.com/gohugoio/hugoAffected
  • >=0.56.0 <0.170.0
Fixed in
  • 0.170.0

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

A fix is available in Hugo version 0.170.0, which rejects any non-local paths in _vendor/modules.txt, preventing path traversal. Users should upgrade to version 0.170.0 or later to remediate this vulnerability. Until upgraded, avoid building sites with untrusted themes or modules.

Description

A path traversal vulnerability in Hugo's vendored module handling allows a malicious theme to cause Hugo to read arbitrary files from the build host. This occurs because Hugo does not properly validate import paths in the _vendor/modules.txt file, enabling directory escapes outside the intended vendor directory. An attacker can exploit this by supplying a theme that references paths outside the project, causing sensitive files such as system or credential files to be read and included in the generated site.

References

Community reviews

Loading reviews…