Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessGain Markdown contributor access
-
DeliveryCraft malicious code-fence info-string with quote and script payload
-
ExploitSubmit Markdown to Hugo site repository
-
ExecutionHugo builds site without escaping info-string
-
PersistVictim visits rendered page
-
ImpactScript executes in victim browser
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | The attacker must have write access to the Markdown source content that Hugo processes - for example, as a registered contributor, a compromised CI pipeline, or via a pull-request workflow that merges unreviewed content. Hugo must be using its built-in default code-block renderer (chroma-based) without a custom render hook that overrides the output template. The affected Hugo version must be between 0.60.0 and 0.163.2. A human victim must visit the page in a browser after the malicious Markdown has been built into the static site. Exploitation is limited by: requirement for prior content-contribution access (PR:L), requirement for victim page-load interaction (UI:P), and the fact that impact is scoped to the victim's browser session rather than the Hugo server or build environment. |
| Impact | The CVSS 4.0 vector AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N correctly captures the key risk limiters: PR:L (the attacker must have content-contribution access) and UI:P (a victim must load the rendered page). The absence of VC/VI/VA impact confirms the vulnerability does not compromise the Hugo build process itself - impact is entirely downstream (SC:L/SI:L) in the visitor's browser session. EPSS data is not provided; given the PR:L and UI:P requirements and no KEV listing, opportunistic mass exploitation is unlikely. This is a realistic risk primarily for Hugo deployments that accept Markdown from multiple or less-trusted contributors (wikis, documentation platforms, multi-author blogs) and publish to audiences who must not be exposed to injected scripts. Single-author static sites where the site owner controls all content are at negligible practical risk. No conflicting signals exist between the CVSS vector and the description - both consistently point to a contributor-access, victim-interaction prerequisite. |
| Exploit ScenarioDerived | A contributor to a multi-author Hugo documentation site submits a Markdown file containing a code block with a crafted info-string such as: |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jul 06, 2026
Stored XSS in Hugo's default code-block renderer allows an attacker with Markdown contribution rights to inject arbitrary JavaScript into generated static pages. Hugo versions 0.60.0 through 0.163.2 write the code-fence info-string (language identifier) directly into HTML attribute values without escaping, so a crafted info-string containing a quote character and script payload breaks out of the attribute context. No public exploit or KEV listing exists at time of analysis; the CVSS 4.0 score of 5.1 reflects the requirement for prior write access and victim interaction.
RemediationAI
Upgrade Hugo to version 0.163.3, the vendor-released patch that introduces HTML escaping of code-fence info-strings before attribute interpolation (fix commit ce1a7e0bce3713af40496ded3c2c0ceeed49231d, pull request https://github.com/gohugoio/hugo/pull/15051). For sites that cannot upgrade immediately, the most effective compensating control is to restrict who can submit Markdown content - if all contributors are fully trusted, the attack surface disappears regardless of Hugo version. A secondary workaround is to override Hugo's default code-block render hook with a custom layout/shortcode that explicitly escapes the info-string using Hugo's htmlEscape function; this adds maintenance overhead but keeps the Hugo version frozen. Disabling syntax highlighting entirely (setting pygmentsCodeFences = false or removing chroma config) eliminates the vulnerable code path but at the cost of losing highlighted code blocks site-wide. No other known compensating control fully mitigates the issue without one of these trade-offs.
Affected VersionsENISA
Affected Packages
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 (cpe:2.3:a:gohugoio:hugo:*:*:*:*:*:*:*:*) is a Go-based static site generator. Its default chroma code-block renderer generates HTML such as <code class="language-X" data-lang="X"> where X is the info-string immediately following the opening triple-backtick fence. From version 0.60.0 onward this string was interpolated into the attribute value without HTML entity encoding. CWE-79 (Improper Neutralization of Input During Web Page Generation / Cross-site Scripting) captures the root cause: a trust boundary is violated when Markdown authored by a less-trusted contributor is rendered into HTML without sanitizing attribute-context metacharacters. A payload such as `go" onload="alert(document.cookie) causes the double-quote to terminate the attribute value and the subsequent text to be parsed as a new event-handler attribute, effectively injecting a live script execution point into the static HTML output Hugo writes to disk.
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
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
PR:L because Markdown write access is required; UI:R for victim page-load; S:C and C:L/I:L for browser-session XSS impact with no server-side effect.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
1DescriptionCVE.org
Hugo is a static site generator. From 0.60.0 until 0.163.3, Hugo's default code-block renderer wrote the Markdown code-fence language or info-string into the code class="language-…" data-lang="…" wrapper without HTML escaping. A fence info-string containing a quote and a script payload breaks out of the attribute and injects a live script element. This issue is fixed in 0.163.3.
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.
Hugo is a fast and Flexible Static Site Generator built in Go. Rated high severity (CVSS 8.5), this vulnerability is rem
Sandbox/permission-restriction bypass in the Hugo static site generator (versions after v0.43, fixed in v0.165.0) lets a
Arbitrary command execution in Hugo 0.162.0 through 0.164.x occurs when the static site generator builds a project whose
Arbitrary file disclosure in the Hugo static site generator (versions after v0.123.0 and before v0.165.0) lets an attack
Symlink-following flaws in Hugo's theme and module mount confinement allow files outside a project's mount roots to be r
Arbitrary file read in Hugo v0.161.0 through v0.165.0 allows an attacker who can contribute content to a Hugo project -
Case-sensitivity bypass in Hugo's security.http.urls IP-literal deny rule lets builds running v0.162.0 through v0.165.x
Server-side request forgery in Hugo static site generator (versions 0.91.0 through 0.165.0) allows an attacker who can s
Local file disclosure in Hugo v0.162.0 through v0.166.x allows an attacker-controlled theme or module to place a symlink
Path traversal in Hugo's asset pipeline lets a malicious theme or module bundle files from outside the project root into
Path traversal in Hugo's css.Sass transpilation pipeline (all versions before v0.167.0) lets a malicious theme or module
Symlink traversal in Hugo's virtual filesystem (v0.123.0-v0.163.0) allows a symlink planted inside a theme or local moun
EUVD-2026-41904
NVD
CVE.org
EPSS
Vulnrichment
GitHub
VulDB
Exploit-DB