Every CVESearch/Get API key

CVE-2026-140395

Hugo 0.56.0 before 0.170.0 Path Traversal via _vendor/modules.txt

Explain with AI
ChatGPTClaudeGoogle AI
Severity
8.7High
Network attack, no privileges, no user interactionCVSS 4.0, CVE ListGitHub Advisories gives 6.7
Exploitation
Unknown
No source reports exploitation yet.
Exploit chance
0.78% in 30 days
Percentile57th
EPSS, scored
Listed fix
0.170.0 for 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:N

Exploit chance over time

Unchanged since Dec 2, 2026
EPSS score 0.78% every day from Dec 2, 2026 to Dec 4, 2026.

Affected

Packages 8

Affected packages
PackageAffectedFixed
github.com/gohugoio/hugo
Go
0.56.0 up to 0.170.0
0.170.0
hugo
Ubuntu: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
hugo
Ubuntu: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
hugo
Ubuntu:20.04:LTS
All versions, plus listed versions
0.57.2-10.58.3-10.59.1-1.10.68.3-1
None listed
hugo
Ubuntu: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 less
0.91.2-10.92.0-10.92.1-1build10.92.2-10.92.2-1ubuntu0.1
None listed
hugo
Ubuntu: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 less
0.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
hugo
Ubuntu:26.10
All versions, plus listed versions
0.154.5-10.162.1-50.162.1-7
None listed
hugo
Ubuntu: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.

Packages named only by advisories that cover several CVEs
PackageAffectedFixed
hugo
Red 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 HighCVSS: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 HighCVSS: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 HighCVSS: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 MediumCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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 MediumCVSS: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 MediumCVSS: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

Changes recorded by Every CVE
DayChangedSources
Affected packages, other IDs, referencesCVE List, NVD, OSV
Affected packages, other IDs, referencesOSV
ReferencesEUVD
ReferencesEUVD
Affected packages, other IDs, key facts, published date, references, severityOSV
Other IDs, published dateEUVD
Other IDs, references, severityGitHub Advisories
SeverityNVD
First indexedCVE List
Affected packages, referencesOSV
First indexedGitHub Advisories

Upstream dates may differ.

References

Show 16 more referencesShow less
MoveEnter Open