CVE-2026-140395
Hugo 0. 56. 0 before 0. 170. 0 Path Traversal via _ vendor/ modules. txt
- Severity
- 8.7HighNetwork attack, no privileges, no user interactionCVSS 4.0, CVE ListGitHub Advisories gives 6.7
- Exploitation
- UnknownNo source reports exploitation yet.
- Exploit chance
- 0.78% in 30 daysPercentile57thEPSS, scored
- Listed fix
0.170.0for github.com/ gohugoio/ hugo From GitHub Advisories and OSV7 other affected packages
Overview
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.
CVSS 4.0 vector
Exploitability
- Attack vector
- Network
- Complexity
- Low
- Attack requirements
- None
- Privileges needed
- None
- User interaction
- None
Impact on the vulnerable system
- Confidentiality
- High
- Integrity
- None
- Availability
- None
Impact on subsequent systems
- Confidentiality
- None
- Integrity
- None
- Availability
- None
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:NExploit chance over time
Affected
Packages 8
| Package | Affected | Fixed |
|---|---|---|
github.com/gohugoio/hugoGo | 0.56.0 up to 0.170.0 | 0.170.0 |
hugoUbuntu:16.04:LTS | All versions, plus listed versions 0.15+git20160109.147.dd1d655-10.15+git20160109.147.dd1d655-20.15+git20160128.179.5def6d9-10.15+git20160206.203.ed23711-1 | None listed |
hugoUbuntu:18.04:LTS | All versions, plus listed versions 0.25.1-20.26-10.35-10.37.1-10.38-10.39-10.40-10.40.1-1 | None listed |
hugoUbuntu:20.04:LTS | All versions, plus listed versions 0.57.2-10.58.3-10.59.1-1.10.68.3-1 | None listed |
hugoUbuntu:22.04:LTS | All versions, plus listed versions 0.80.0-60.89.4-20.90.0-10.90.1-10.91.0-1 Show 5 more versionsShow less0.91.2-10.92.0-10.92.1-1build10.92.2-10.92.2-1ubuntu0.1 | None listed |
hugoUbuntu:Pro:24.04:LTS | All versions, plus listed versions 0.113.0-30.119.0-20.120.3-10.120.4-10.121.2-1 Show 8 more versionsShow less0.122.0-10.123.7-1build10.123.7-1ubuntu0.10.123.7-1ubuntu0.20.123.7-1ubuntu0.2+esm10.123.7-1ubuntu0.30.123.7-1ubuntu0.3+esm10.123.7-1ubuntu0.3+esm2 | None listed |
hugoUbuntu:26.10 | All versions, plus listed versions 0.154.5-10.162.1-50.162.1-7 | None listed |
hugoUbuntu:26.04:LTS | All versions, plus listed versions 0.131.0-10.152.2-10.153.1-30.153.2-10.154.2-20.154.3-10.154.5-1 | None listed |
Only in multi-CVE advisories 1
Each of these advisories covers several CVEs at once, so it doesn’t establish that this one affects the package.
| Package | Affected | Fixed |
|---|---|---|
hugoRed Hat:hummingbird:1 | before 0:0.170.1-0.1.hum1 From an advisory covering 2 CVEs | 0:0.170.1-0.1.hum1 |
Products 1
Sources
CVE List Score usedCVSS 4.08.7
Hugo 0.56.0 before 0.170.0 Path Traversal via _vendor/modules.txt
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.
- Record
CVE-2026-140395- CVSS 4.0
- 8.7 High
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N - CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-22
- Updated
- 2026-12-02
EUVDEUVD-2026-140248CVSS 4.08.7
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.
- Record
EUVD-2026-140248- CVSS 4.0
- 8.7 High
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N - Updated
- 2026-12-01
GitHub AdvisoriesGHSA-r48v-r4vw-h9v8CVSS 4.06.7
Hugo: Build-host file disclosure through path traversal in vendored module metadata
Summary
A theme or module can ship a _vendor/modules.txt with an import path containing .. segments. Hugo used this path as the module's root directory without checking that it stays inside _vendor, so a malicious theme can make Hugo treat any directory on the build host (up to /) as its module root and read files from it.
Details
collectModulesTXT in modules/collect.go builds the vendored module directory with filepath.Join(vendorDir, path), where path comes straight from _vendor/modules.txt. When an import resolves through the vendor list, Hugo uses that directory as is and skips the checks that normally keep a theme under themesDir. The resulting root is added to Hugo's filesystem overlay, which makes files outside the project available to readFile, resources.Get, os.ReadFile and mounts (e.g. a static mount that publishes the directory).
The fix rejects any modules.txt path that is not local (filepath.IsLocal), so the build fails with an invalid module path error.
Proof of concept
A site uses an untrusted theme (theme = "evil"). The theme imports ../../../.. and lists the same path in its _vendor/modules.txt. A template then calls readFile on a path relative to the escaped root, e.g. a file outside the project or a system file such as etc/passwd. Its content ends up in the generated site.
Impact
Anyone building a site with an untrusted theme or module, for example in CI or on a hosted build service, can have files on the build host read and published in the site. This includes secrets, credentials and system files. No change to the site configuration beyond importing the theme is needed.
- Record
GHSA-r48v-r4vw-h9v8- CVSS 4.0
- 6.7 Medium
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 - Weakness
- CWE-22
- Updated
- 2026-12-01
GitHub AdvisoriesGHSA-rhmv-h4x2-hfcrCVSS 4.08.7
Hugo from 0.56.0 before 0.170.0 contains a path traversal vulnerability that allows malicious...
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.
- Record
GHSA-rhmv-h4x2-hfcr- CVSS 4.0
- 8.7 High
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-22
- Updated
- 2026-12-01
NVDCVSS 4.08.7
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.
- Record
CVE-2026-140395- CVSS 4.0
- 8.7 High
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-22
- Updated
- 2026-12-02
OSVCVSS 4.08.7
Hugo 0.56.0 before 0.170.0 Path Traversal via _vendor/modules.txt
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.
- Record
CVE-2026-140395- CVSS 4.0
- 8.7 High
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N - Weakness
- CWE-22
- Updated
- 2026-12-01
OSVGHSA-r48v-r4vw-h9v8CVSS 4.06.7
Hugo: Build-host file disclosure through path traversal in vendored module metadata
Summary
A theme or module can ship a _vendor/modules.txt with an import path containing .. segments. Hugo used this path as the module's root directory without checking that it stays inside _vendor, so a malicious theme can make Hugo treat any directory on the build host (up to /) as its module root and read files from it.
Details
collectModulesTXT in modules/collect.go builds the vendored module directory with filepath.Join(vendorDir, path), where path comes straight from _vendor/modules.txt. When an import resolves through the vendor list, Hugo uses that directory as is and skips the checks that normally keep a theme under themesDir. The resulting root is added to Hugo's filesystem overlay, which makes files outside the project available to readFile, resources.Get, os.ReadFile and mounts (e.g. a static mount that publishes the directory).
The fix rejects any modules.txt path that is not local (filepath.IsLocal), so the build fails with an invalid module path error.
Proof of concept
A site uses an untrusted theme (theme = "evil"). The theme imports ../../../.. and lists the same path in its _vendor/modules.txt. A template then calls readFile on a path relative to the escaped root, e.g. a file outside the project or a system file such as etc/passwd. Its content ends up in the generated site.
Impact
Anyone building a site with an untrusted theme or module, for example in CI or on a hosted build service, can have files on the build host read and published in the site. This includes secrets, credentials and system files. No change to the site configuration beyond importing the theme is needed.
- Record
GHSA-r48v-r4vw-h9v8- CVSS 4.0
- 6.7 Medium
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 - Weakness
- CWE-22
- Updated
- 2026-12-01
OSVRHSA-2026:104146CVSS 3.15.5
Red Hat Security Advisory: Red Hat Hardened Images RPMs bug fix and enhancement update
- Record
RHSA-2026:104146- CVSS 3.1
- 5.5 Medium
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N - Updated
- 2026-12-02
OSVUBUNTU-CVE-2026-140395No score
(Hugo from 0.56.0 before 0.170.0 contains a path traversal vulnerabilit ...)
- Record
UBUNTU-CVE-2026-140395- Updated
- 2026-12-03
History
Recorded by Every CVE
| Day | Changed | Sources |
|---|---|---|
| Affected packages, other IDs, references | CVE List, NVD, OSV | |
| Affected packages, other IDs, references | OSV | |
| References | EUVD | |
| References | EUVD | |
| Affected packages, other IDs, key facts, published date, references, severity | OSV | |
| Other IDs, published date | EUVD | |
| Other IDs, references, severity | GitHub Advisories | |
| Severity | NVD | |
| First indexed | CVE List | |
| Affected packages, references | OSV | |
| First indexed | GitHub Advisories |
Upstream dates may differ.
References
github.com/gohugoio/hugo/security/advisories/GHSA-r48v-r4vw-h9v8
vulncheck.com/advisories/hugo-0.56.0-before-0.170.0-path-traversal-via-vendor-modules-txt
github.com/gohugoio/hugo/pull/15564
github.com/gohugoio/hugo/commit/d41a8a196e6b2fd5e5aa886c790d6c679dd73be0
github.com/gohugoio/hugo/releases/tag/v0.170.0
github.com/advisories/GHSA-r48v-r4vw-h9v8
nvd.nist.gov/vuln/detail/CVE-2026-140395
github.com/advisories/GHSA-rhmv-h4x2-hfcr
Show 16 more referencesShow less
github.com/CVEProject/cvelistV5/tree/main/cves/2026/140xxx/CVE-2026-140395.json
github.com/gohugoio/hugo
access.redhat.com/errata/RHSA-2026:104146
images.redhat.com
access.redhat.com/security/cve/CVE-2026-140395
access.redhat.com/security/updates/classification
access.redhat.com/security/cve/CVE-2026-140394
security.access.redhat.com/data/csaf/v2/advisories/2026/rhsa-2026_104146.json
bugzilla.redhat.com/show_bug.cgi?id=2587938
cve.org/CVERecord?id=CVE-2026-140394
nvd.nist.gov/vuln/detail/CVE-2026-140394
github.com/gohugoio/hugo/security/advisories/GHSA-4whp-jx7j-xvrm
vulncheck.com/advisories/hugo-0.140.2-before-0.170.0-stored-xss-via-highlight-shortcode-wrapperclass
bugzilla.redhat.com/show_bug.cgi?id=2587951
cve.org/CVERecord?id=CVE-2026-140395
ubuntu.com/security/CVE-2026-140395