Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAuthenticate as a content author (PR:L)
-
ExploitAdd highlight shortcode with crafted wrapperClass payload
-
ExecutionwrapperClass written unescaped into div class attribute at build
-
ImpactStored script executes in visitors' browsers under site origin
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 authenticated content author (PR:L) on a Hugo site running an affected version (>=0.140.2, <0.170.0) who can author page content using the built-in highlight shortcode or the transform.Highlight template function; both are enabled by default, so no non-default configuration is needed. The attacker sets the wrapperClass option to a value that closes the class attribute and appends a <script> element, which markup/highlight/highlight.go writes unescaped into the wrapping div. Limiting factors: the site must render content from less-trusted authors (single-author or fully-trusted-author sites face no meaningful risk), a visitor must load the rendered page for the stored script to fire (UI:P), and Goldmark's unsafe setting and Markdown code fences are irrelevant because the value never passes through the Markdown HTML renderer. Markdown code fences are not affected. |
| Impact | This is a medium-severity stored XSS (CVSS 4.0 base 5.1) whose real-world risk is tightly bounded by its threat model rather than by raw network reach. The vector CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P confirms network attack surface and low complexity, but PR:L means exploitation requires an authenticated content author, and UI:P means a visitor must view the rendered page - so this is an insider/multi-author abuse case, not a remote-unauthenticated mass-exploitation case. Impact is limited: VC/VI/VA are all N while only subsequent-system SC:L/SI:L apply, consistent with script execution in a visitor's browser under the site origin rather than compromise of the Hugo build host. SSVC aligns with this moderate reading: Exploitation=poc (a proof of concept, not confirmed active exploitation), Automatable=no, Technical Impact=partial. No EPSS score was supplied and the CVE is not in CISA KEV, so there is no signal of widespread or active exploitation. The vuln.today priority is this_month (not act_now/emergency). Net: a legitimate issue to patch on a normal cycle, materially relevant to sites that render content from less-trusted authors, but low priority for single-author or trusted-author deployments. No signals are strongly conflicting; the main missing data is EPSS, and the PoC is described conceptually in the advisory rather than published as verified working exploit code. |
| Exploit ScenarioDerived | On a multi-author Hugo site, a content author adds the built-in highlight shortcode (or uses transform.Highlight) with a wrapperClass value that closes the class attribute and appends a <script> element; when the site is built, the script is written unescaped into the wrapping div and executes in every visitor's browser under the site's origin. The GHSA advisory includes a conceptual proof of concept, and SSVC rates exploitation as poc. Exploitation requires an authoring account (PR:L) and a visitor loading the page (UI:P), so it is realistic mainly where untrusted or semi-trusted authors can publish content. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Dec 02, 2026
Stored cross-site scripting in Hugo 0.140.2 through 0.169.x allows a content author to inject a script into rendered pages by setting the highlight shortcode's wrapperClass option to a value that breaks out of the wrapping div's class attribute. The flaw lives in markup/highlight/highlight.go, which wrote wrapperClass unescaped while escaping every other attribute, and it also affects the transform.Highlight template function; both are built in and enabled by default. Exploitation requires an authenticated content author (PR:L) on a site that renders content from less-trusted authors, and a visitor must load the affected page (UI:P) for the stored script to run under the site's origin. A public proof-of-concept reference exists and SSVC records proof-of-concept exploitation; it is not verified as working exploit code, there is no CISA KEV listing, and the vendor-released fix is Hugo 0.170.0.
RemediationAI
Vendor-released patch: upgrade to Hugo 0.170.0 or later, which HTML-escapes wrapperClass in writeDivStart; the upstream change is PR https://github.com/gohugoio/hugo/pull/15564, commit https://github.com/github.com/gohugoio/hugo/commit/bdde5aa5155c6c349a743e71dc846bef754b6773, and the advisory is at https://github.com/gohugoio/hugo/security/advisories/GHSA-4whp-jx7j-xvrm. Rebuild and redeploy sites after upgrading, since the vulnerable output is baked into generated HTML at build time; stale prebuilt artifacts remain dangerous until rebuilt. No configuration toggle is documented in the supplied evidence as a full workaround - the highlight shortcode and transform.Highlight are built in and on by default, and the Goldmark unsafe setting does not mitigate the issue. The practical compensating control is to restrict page-authoring rights to trusted authors and review content for wrapperClass values in highlight shortcode calls or transform.Highlight invocations before building, accepting that this is a manual review burden that does not scale on multi-author sites and offers no protection once untrusted content is accepted. Note that single-author or fully-trusted-author sites face no meaningful risk from this issue, and the vendor's escaping fix is the only complete remediation. Patch priority per the supplied decision label is this_month.
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 is a Go-based static site generator. The vulnerability is CWE-79 (improper neutralization of input during web page generation) in the built-in highlight rendering path: the shortcode options string is decoded into the highlight configuration, so a content author controls wrapperClass, and writeDivStart in markup/highlight/highlight.go concatenated that value directly between class=" and " when emitting the wrapping div. Every other attribute value in the same writer was HTML-escaped, making this a single missing-escape defect rather than a design flaw in the renderer. Because the value never passes through Goldmark's Markdown HTML renderer, the Goldmark unsafe setting has no bearing on the issue, and Markdown code fences are not affected - only the highlight shortcode and the transform.Highlight template function are. The upstream fix HTML-escapes the value (PR 15564, commit bdde5aa5155c6c349a743e71dc846bef754b6773, released in 0.170.0). CPE cpe:2.3:a:gohugoio:hugo enumerates the affected Go module github.com/gohugoio/hugo for versions >= 0.140.2 and < 0.170.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 sets the payload (PR:L), a visitor must load the page (UI:R), and script runs in the browser under site origin, crossing a trust boundary (S:C) with limited C/I impact.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
2DescriptionCVE.org
Hugo after 0.140.2 and before 0.170.0 contains a stored cross-site scripting vulnerability in the highlight shortcode and transform.Highlight template function, which write the wrapperClass option unescaped into the wrapping div's class attribute. Content authors can supply a wrapperClass value that closes the attribute and appends a script element, executing JavaScript in visitors' browsers under the site's origin.
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
Path traversal in Hugo 0.56.0 through 0.169.x allows a malicious theme or module to treat any build-host directory as it
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
EUVD-2026-140249
GHSA-332r-53xh-x52j
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB