Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessObtain content-author repository access
-
DeliveryCraft malicious code-fence info string with quote-escape payload
-
ExploitCommit Markdown file to site source
-
ExecutionHugo renders page with unescaped attribute value in HTML
-
PersistVictim visits generated page
-
ImpactEvent-handler JavaScript executes in victim's browser session
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 | Exploitation requires that the attacker hold low-privilege content-authoring access to the Hugo site's Markdown source - for example, repository write access or equivalent CMS contributor rights (CVSS PR:L). The victim must actively load the rendered HTML page in a browser (CVSS UI:A). Hugo's default configuration is sufficient: code fences must be enabled (which they are by default) and no custom render hook for code blocks must be present (custom hooks would replace the vulnerable renderer). Goldmark's |
| Impact | The CVSS 4.0 score of 4.8 (Medium) accurately reflects the real-world risk profile: network-accessible (AV:N), low complexity (AC:L), but gated behind low-privilege content-author access (PR:L) and requiring a victim to actively load the page (UI:A). The stored nature of the XSS elevates practical impact relative to reflected variants - a single malicious markdown commit persists and fires for every subsequent visitor without further attacker interaction, which means even a modestly trafficked site operated by a mid-sized team such as a municipal portal or SME publisher faces meaningful user-impact scope. No EPSS score was available in the provided data, and the vulnerability is absent from CISA KEV, so there is no confirmed evidence of active exploitation at time of analysis. The primary real-world limiting factor is the PR:L requirement: exploitability depends on a threat actor having content-authoring access (e.g., a malicious or compromised contributor), which narrows the attack surface compared to unauthenticated injection. The CVSS 4.0 subsequent-system metrics (SC:L/SI:L) correctly capture that the confidentiality and integrity impact falls on victims' browser sessions rather than the Hugo build infrastructure itself. |
| Exploit ScenarioDerived | An attacker with content-author access to a Hugo-based site (for example, a repository contributor or a compromised CI account) commits a Markdown file containing a fenced code block whose info string includes an attribute value with an embedded double-quote followed by an event handler, such as |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 24, 2026
Stored cross-site scripting in Hugo's fenced-code-block renderer (versions 0.93.0 through 0.165.0) allows a low-privileged content author to inject arbitrary JavaScript into statically generated HTML pages by embedding crafted attribute values in a code-fence info string. The vulnerability arises because Hugo's markup/internal/attributes/attributes.go converts attribute values from byte slices to strings during storage, silently bypassing the escaping branch in RenderAttributes that only operates on byte slice types - contradicting the function's own documentation. Every visitor who loads an affected page executes the injected script; no public exploit identified at time of analysis, and exploitation has not been confirmed in CISA KEV.
RemediationAI
Upgrade Hugo to a version above 0.165.0 once a patched release is published by the Hugo project; monitor the upstream repository at https://github.com/gohugoio/hugo for release tags and the associated changelog. No exact fixed version number is confirmed in the available data - the upstream fix is identifiable in the source but a tagged release has not been independently verified. As an interim workaround, site operators can implement a custom render hook for code blocks that explicitly escapes attribute values before writing them to HTML output, preventing the vulnerable default renderer from being invoked; this requires authoring a layouts/_default/_markup/render-codeblock.html template. An alternative is to restrict content-authoring access to fully trusted contributors only, eliminating the PR:L threat actor class. Disabling code-fence attribute syntax entirely is not straightforward without a custom render hook, and the goldmark unsafe setting is unrelated and does not mitigate this issue. See the VulnCheck advisory at https://www.vulncheck.com/advisories/hugo-through-stored-cross-site-scripting-via-unescaped-code-fence-attribute-values for additional detail.
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 (CPE: cpe:2.3:a:gohugoio:hugo:*:*:*:*:*:*:*:*) is a Go-based static site generator that uses the Goldmark Markdown processor for rendering. The vulnerable code path runs through the fenced-code-block pipeline: markup/goldmark/codeblocks/render.go and markup/highlight/highlight.go both invoke RenderAttributes in markup/internal/attributes/attributes.go. The root cause (CWE-79 - Improper Neutralization of Input During Web Page Generation) is a type-conversion bug: the New function stores attribute values as Go string types, but RenderAttributes escapes only values that remain as []byte. Because no value survives as a byte slice, the escaping branch is dead code and every attribute value is written verbatim into the HTML output. The existing on* attribute name filter is rendered irrelevant because the attack vector is the attribute value: a double-quote in the value terminates the current attribute and allows the attacker to append new attributes - including event handlers - to the wrapper element. This path is reachable under Hugo's default configuration with code fences enabled, without requiring goldmark's unsafe mode or any custom render hook.
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:A/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N
Stored XSS with scope change (S:C) to visitor browsers; PR:L for content-author prerequisite; UI:R for victim page load; no availability impact.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
DescriptionCVE.org
Hugo's default fenced-code-block renderer writes attribute values taken from the code-fence info string into the rendered HTML without escaping them. New in markup/internal/attributes/attributes.go converts every attribute value from a byte slice to a string as it is stored, deliberately dropping the escaping that used to happen there, and RenderAttributes in the same file escapes only values that are still byte slices, so its escaping branch is never reached and every value is written verbatim. The function's documentation states that it performs HTML escaping of string attributes, which it does not. A quote inside an attribute value in the info string therefore terminates the attribute and allows a further attribute, including an event handler, to be placed on the wrapper element, and the script runs for every visitor who loads the page. This path is reached under the default configuration, with code fences enabled and without goldmark's unsafe setting or any custom render hook. Attribute names beginning with on are filtered when the attributes are parsed, so injection is achieved through the value rather than the name.
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-64776
GHSA-2gp4-jcxx-7hpr
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB