Skip to main content

Hugo CVE-2026-140395

| EUVDEUVD-2026-140248 HIGH
Path Traversal (CWE-22)
2026-12-01 VulnCheck GHSA-rhmv-h4x2-hfcr
8.7
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Operator adopts untrusted theme/module
  2. Delivery
    Theme ships _vendor/modules.txt with '..' path
  3. Exploit
    Hugo treats escaped directory as module root
  4. Execution
    Template readFile or static mount targets host files
  5. Impact
    Secrets and system files published in generated site

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK

2 techniques across 2 tactics: Discovery, Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires that the build process consume an attacker-controlled Hugo theme or module containing a crafted _vendor/modules.txt whose import path uses '..' segments; the malicious directory is then used as a module root and read via readFile, resources.Get, os.ReadFile, or a static mount. The decisive precondition - and principal limiter - is that a site operator must import/trust the malicious theme or module; sites built only from trusted, first-party content are not exposed. Highest exposure is CI and hosted/shared build services that build third-party themes, where host secrets and credentials are present on the build machine. No special site configuration beyond importing the theme is needed, and no authentication on a target service is required. A public PoC reference exists in the GHSA advisory; it is not verified as packaged working exploit code. The only complete fix stated by the vendor is upgrading to Hugo 0.170.0, which rejects non-local (filepath.IsLocal) module paths.

Impact

This is a genuine but conditional risk rather than a drop-everything emergency, and the signals are largely consistent. The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N) scores 8.7 (High) and emphasizes confidentiality only (VC:H, VI:N, VA:N) with no scope change (SC/SI/SA:N), which matches the mechanism: a malicious theme or module reads build-host files but cannot modify or deny service. The vendor-assigned PR:N/UI:N is defensible only because the vector treats 'supplying a malicious theme' as the attack itself; in practice exploitation requires a site operator to adopt an untrusted theme/module, so the real-world precondition behaves like required user action - a material limiter the raw score hides. No EPSS score and no KEV listing are present in the input, so there is no evidence of active or widespread exploitation; the vuln.today decision label is 'this_week' (not act_now/emergency), consistent with a serious, patch-this-week issue rather than an active-exploitation crisis. The GHSA advisory includes a proof-of-concept description, but the input does not confirm packaged working exploit code. Net: credible, patch available (0.170.0), highest concern for CI systems and hosted build services that build third-party themes; lower concern for operators who only build their own trusted content.

Exploit ScenarioDerived

A CI pipeline or hosted build service builds a Hugo site that uses an attacker-supplied theme (theme = "evil"). The theme ships a _vendor/modules.txt whose import path contains '..' segments, causing Hugo to treat a directory outside the project (up to /) as a module root; a template then calls readFile (or a static mount) on a host path such as etc/passwd or a credentials file, and the content is published in the generated site. The GHSA advisory documents this proof-of-concept flow; the input does not confirm packaged working exploit code.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.8% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Dec 02, 2026

Path traversal in Hugo 0.56.0 through 0.169.x allows a malicious theme or module to treat any build-host directory as its module root and publish files such as credentials or /etc/passwd into the generated site. Exploitation requires the site operator to import the attacker-controlled theme or module, so sites built only from trusted first-party content are not exposed, while CI and hosted build services carrying secrets are the highest-risk deployments. A public PoC reference exists in the GHSA advisory; it is not verified as working exploit code, and no CISA KEV entry is associated with this CVE.

RemediationAI

Upgrade to Hugo 0.170.0, the version that rejects non-local module paths via filepath.IsLocal; the upstream fix is PR #15564 and commit d41a8a196e6b2fd5e5aa886c790d6c679dd73be0. The vendor describes upgrading as the only complete fix, so no patch-equivalent configuration workaround is documented: before upgrading, the exposure is limited to builds that consume attacker-controlled themes or modules, so not importing untrusted themes or modules in CI or on hosted build services avoids the precondition but is not a substitute for the fix. Advisory: https://github.com/gohugoio/hugo/security/advisories/GHSA-r48v-r4vw-h9v8.

Affected VersionsENISA

hugo 0.56.0 <0.170.0

Affected Packages

go github.com/gohugoio/hugo fix: 0.170.0
euvd hugo fix: 0.170.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in go, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Hugo is a Go static site generator that supports themes and modules; vendored module metadata lives in _vendor/modules.txt, and collectModulesTXT in modules/collect.go built the vendored module directory with filepath.Join(vendorDir, path) using an import path taken directly from that file. Because the path was not validated, '..' segments let the resolved directory escape _vendor, and Hugo then used it as the module root and skipped the checks that normally keep a theme under themesDir; that root is added to Hugo's filesystem overlay, exposing files outside the project to readFile, resources.Get, os.ReadFile and mounts such as a static mount. The root cause is CWE-22 path traversal, and the upstream fix applies filepath.IsLocal to reject non-local modules.txt paths so the build fails with an 'invalid module path' error.

Know when Hugo gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (VulnCheck) PRIMARY 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
vuln.today AI 6.5 MEDIUM

Operator must import an untrusted theme/module (UI:R); attacker needs no privileges (PR:N) and the flaw only discloses files (C:H, I:N, A:N) within Hugo's own build process (S:U).

3.1 AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N
4.0 AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch available
Dec 01, 2026 - 16:02 EUVD
CVE Published
Dec 01, 2026 - 14:29 cve.org
HIGH 8.7

DescriptionCVE.org

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.

Technical POC Analysis

Evidence base: advisory GHSA-r48v-r4vw-h9v8 only.

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Executive ViewAI

Why It Matters

Hugo static site generator versions 0.56.0 through 0.169.x contain a high-severity path traversal flaw that allows a malicious theme or module to exfiltrate sensitive files (credentials, system files) into the generated website. Organizations using untrusted third-party Hugo themes or modules in CI/CD pipelines or hosted build services face direct risk of secret disclosure, while sites built exclusively from trusted first-party content are not exposed.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.8%
Top 43% exploitable
Prevalence
High
extremely popular static site generator, heavily used in CI and hosted builds
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.8%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
High

Priority Score

45
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +44
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

More in Hugo

View all
CVE-2020-26284 HIGH POC
8.5 Dec 21

Hugo is a fast and Flexible Static Site Generator built in Go. Rated high severity (CVSS 8.5), this vulnerability is rem

CVE-2026-89259 CRITICAL
9.3 Sep 11

Sandbox/permission-restriction bypass in the Hugo static site generator (versions after v0.43, fixed in v0.165.0) lets a

CVE-2026-75926 CRITICAL
9.3 Aug 18

Arbitrary command execution in Hugo 0.162.0 through 0.164.x occurs when the static site generator builds a project whose

CVE-2026-89258 CRITICAL
9.3 Sep 11

Arbitrary file disclosure in the Hugo static site generator (versions after v0.123.0 and before v0.165.0) lets an attack

CVE-2026-100692 HIGH
8.7 Sep 26

Symlink-following flaws in Hugo's theme and module mount confinement allow files outside a project's mount roots to be r

CVE-2026-100690 HIGH
8.7 Sep 26

Arbitrary file read in Hugo v0.161.0 through v0.165.0 allows an attacker who can contribute content to a Hugo project -

CVE-2026-100693 HIGH
8.6 Sep 26

Case-sensitivity bypass in Hugo's security.http.urls IP-literal deny rule lets builds running v0.162.0 through v0.165.x

CVE-2026-10582 HIGH
8.3 Aug 24

Server-side request forgery in Hugo static site generator (versions 0.91.0 through 0.165.0) allows an attacker who can s

CVE-2026-109596 MEDIUM
6.7 Oct 12

Local file disclosure in Hugo v0.162.0 through v0.166.x allows an attacker-controlled theme or module to place a symlink

CVE-2026-109595 MEDIUM
6.7 Oct 12

Path traversal in Hugo's asset pipeline lets a malicious theme or module bundle files from outside the project root into

CVE-2026-109574 MEDIUM
6.7 Oct 12

Path traversal in Hugo's css.Sass transpilation pipeline (all versions before v0.167.0) lets a malicious theme or module

CVE-2026-58403 MEDIUM
5.9 Jul 06

Symlink traversal in Hugo's virtual filesystem (v0.123.0-v0.163.0) allows a symlink planted inside a theme or local moun

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy