CVE-2026-140395 — gohugoio hugo
One of 2 gohugoio hugo vulnerabilities published together by NVD: our article covers all of them.
WebVulnerabilitiesSummary
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.
Severity breakdown
High · 8.7
An attacker without an account can exploit this over the network, without any user action.
- Attack from
- the network (remotely)
- Attack complexity
- low (no special conditions)
- Special conditions
- none
- Login needed
- no
- User action needed
- no
- Impact
- high on confidentiality, none on integrity and availability
- Impact on other systems
- none
Weakness
- CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected and fixed versions
| Product | Affected versions | Fixed in |
|---|---|---|
| gohugoio hugo | ≥ 0.56.0, < 0.170.0 | 0.170.0 |
References by type
Vendor advisories
Other references
Affected
- gohugoio hugo
What to do
- Check whether you run an affected product or version and apply the vendor's update or mitigation.
- Follow the vendor advisory and the references below for fixed versions and workarounds.
Frequently asked questions
What is CVE-2026-140395?
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. Weakness type: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (CWE-22).
How severe is CVE-2026-140395?
CVE-2026-140395 has a CVSS 4.0 base score of 8.7 (high), from the CNA (vulncheck.com). An attacker without an account can exploit this over the network, without any user action.
Is CVE-2026-140395 being exploited?
Not as far as is known: CVE-2026-140395 is not in CISA's Known Exploited Vulnerabilities catalog as of December 3, 2026. EPSS estimates a 0.8% chance that it is exploited in the next 30 days.
Which versions are affected by CVE-2026-140395?
gohugoio hugo ≥ 0.56.0, < 0.170.0 (fixed in 0.170.0).
How do I fix CVE-2026-140395?
Update to a fixed release: gohugoio hugo 0.170.0.