Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessObtain Markdown authoring access
-
DeliverySubmit heading with crafted explicit ID
-
ExploitBreak out of unescaped href in TOC/Fragments output
-
ExecutionStore malicious markup in rendered page
-
ImpactVictim views page and JS executes in 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 | Requires an attacker with Markdown content-authoring privileges (CVSS PR:L) who can supply crafted explicit heading IDs (e.g. a '{#...}' attribute block on a heading), on a Hugo site at version >= v0.60.0 and < v0.167.0 that renders the .TableOfContents or .Fragments.ToHTML output where the heading ID is placed into an unescaped href attribute. Exploitation is further limited by required victim interaction (UI:P - a user must view the rendered page) and by the deployment pattern: it is only relevant where Hugo processes Markdown from multiple or untrusted authors, not single-author sites built from a fully trusted source repository. |
| Impact | This is a moderate-severity stored XSS (CVSS 4.0 base 5.1, CWE-79) that in practice is a lower-priority issue than its 'network' attack vector might first suggest. The provided 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) is internally consistent with the description: PR:L reflects that the attacker must already be a privileged Markdown content author, UI:P reflects that a victim must view the rendered page, and the impact lands on the subsequent system (SC:L/SI:L - the victim's browser) with no impact to the Hugo build system itself (VC/VI/VA:N). There is no EPSS score, no CISA KEV listing, and no public POC referenced, so by the precision rules this is 'no public exploit identified at time of analysis.' The dominant mitigating factor is the PR:L prerequisite - exploitation is only meaningful where Hugo renders Markdown from multiple or semi-trusted authors (e.g. community docs, multi-contributor sites, or pipelines ingesting externally-supplied Markdown); a single-author blog built from a trusted repository is not realistically at risk. Net: a real but bounded defect, worth patching on multi-author deployments, not an emergency. |
| Exploit ScenarioDerived | On a Hugo site that accepts Markdown from multiple contributors (e.g. a community documentation portal), a malicious author submits a page whose heading uses a crafted explicit ID that breaks out of the unescaped href attribute generated by .TableOfContents or .Fragments.ToHTML. When another user or administrator views the rendered page, the injected element with an event handler executes attacker-controlled JavaScript in their browser. No public exploit code is referenced, but the technique is straightforward given the described attribute-breakout. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 12, 2026
Stored cross-site scripting in the Hugo static site generator (versions v0.60.0 up to but not including v0.167.0) lets anyone holding Markdown content-authoring privileges break out of the href attribute generated for heading anchors by .TableOfContents or .Fragments.ToHTML and inject arbitrary HTML elements carrying event handlers into the rendered page. The issue is scored CVSS 4.0 base 5.1 (CWE-79) and requires low-privileged content access (PR:L) plus a victim viewing the poisoned page (UI:P); because the injected content is only dangerous when Hugo processes Markdown from multiple or untrusted authors, single-author sites built from a fully trusted repository are effectively not exposed. No public exploit code was identified at the time of analysis and the flaw has not been confirmed actively exploited (no CISA KEV listing), making this a moderate-priority hardening item rather than an urgent remote-code-execution-class emergency.
RemediationAI
Upgrade Hugo to v0.167.0 or later, which is the version boundary at which the affected range ends and the escaping of heading IDs in .TableOfContents and .Fragments.ToHTML output is corrected; rebuild and redeploy the site so previously generated HTML is regenerated with the fixed renderer (stale pre-built pages remain poisoned until that rebuild). If an immediate upgrade is not possible, the highest-value compensating control is to stop processing Markdown from untrusted or multi-tenant authors until the generator is patched, accepting the operational cost of restricting who can commit content or merging author submissions only through editorial review. A secondary mitigation is to post-process the generated HTML with a sanitizer (for example bluemonday for Go build pipelines or DOMPurify in a build step) before deployment, which strips event-handler attributes and injected elements regardless of Hugo version, at the cost of build-pipeline complexity and the risk of over-sanitizing legitimate theme markup. Deploying a Content Security Policy that omits 'unsafe-inline' for script-src and blocks inline event handlers will neutralize the practical impact in modern browsers, but it does not remove the injected markup, can break themes that rely on inline scripts, and depends on browser CSP support, so it should be treated as defense in depth rather than a fix. Sites that cannot upgrade and cannot sanitize output may temporarily avoid the vulnerable helpers, dropping .TableOfContents or .Fragments.ToHTML from templates, though this removes navigation features users depend on.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in 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-based static site generator that converts Markdown into HTML at build time; heading IDs can be set explicitly by authors using attribute blocks such as '{#custom-id}'. Two built-in template helpers, .TableOfContents and .Fragments.ToHTML, emit those heading IDs as fragments inside href attributes of anchor links. The vulnerability class is CWE-79 (improper neutralization of input during web page generation, i.e. cross-site scripting): the heading ID value was placed into the href attribute without escaping, so a crafted ID containing quote characters and markup terminates the attribute and introduces new elements such as an image or link with an onerror/onclick handler. The CPE cpe:2.3:a:gohugoio:hugo:*:*:*:*:*:*:*:* confirms the affected component is Hugo itself rather than a theme or downstream plugin, and the scope-changed CVSS 4.0 vector (SC:L/SI:L) reflects that the injected script executes in the context of pages generated by the site, not within Hugo's own build process. Modern Hugo uses the Goldmark Markdown renderer, whose heading-ID handling supports these explicit attribute blocks, which is why the vulnerable range begins at v0.60.0 (the release that standardized the current heading-ID behavior) and ends just before the fixed v0.167.0.
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
Authenticated content author (PR:L), victim must render the page (UI:R), stored XSS executes in a different security context so S:C with low C/I impact and no availability impact.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
1DescriptionCVE.org
Hugo from v0.60.0 before v0.167.0 contains a stored cross-site scripting vulnerability that allows Markdown content authors to inject HTML by supplying crafted explicit heading IDs. Attackers can break out of the unescaped href attribute in .TableOfContents or .Fragments.ToHTML output to inject elements with event handlers into rendered pages.
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-98160
GHSA-hh58-7hgh-xf3r
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB