CVE-2026-58402: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in gohugoio hugo
A cross-site scripting (XSS) vulnerability exists in the Hugo static site generator's default code-block renderer from versions 0.60.0 up to 0.163.3. The vulnerability occurs because the Markdown code-fence language or info-string is written into HTML attributes without proper escaping, allowing injection of malicious scripts. This issue is fixed starting in version 0.163.3.
AI Analysis
Technical Summary
Hugo versions from 0.60.0 until 0.163.3 have an XSS vulnerability (CWE-79) in the default code-block renderer. The renderer inserts the Markdown code-fence language or info-string directly into the code element's class and data-lang attributes without HTML escaping. If an attacker crafts a fence info-string containing a quote and a script payload, it can break out of the attribute context and inject executable script code into the generated page. This vulnerability is addressed in version 0.163.3.
Potential Impact
An attacker can inject malicious scripts into pages generated by vulnerable Hugo versions, potentially leading to cross-site scripting attacks when users view the affected pages. This can result in execution of arbitrary scripts in the context of the site, impacting confidentiality and integrity of user interactions. The CVSS 4.0 base score is 5.1 (medium severity), reflecting network attack vector, low complexity, and limited privileges required.
Mitigation Recommendations
Upgrade to Hugo version 0.163.3 or later, where this vulnerability is fixed by properly escaping the code-fence language/info-string before inserting it into HTML attributes. No other mitigation or temporary workaround is indicated in the available data.
CVE-2026-58402: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in gohugoio hugo
Description
A cross-site scripting (XSS) vulnerability exists in the Hugo static site generator's default code-block renderer from versions 0.60.0 up to 0.163.3. The vulnerability occurs because the Markdown code-fence language or info-string is written into HTML attributes without proper escaping, allowing injection of malicious scripts. This issue is fixed starting in version 0.163.3.
CVSS v4.0
Score 5.1medium
Affected software
pkg:golang/github.com/gohugoio/hugoRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Hugo versions from 0.60.0 until 0.163.3 have an XSS vulnerability (CWE-79) in the default code-block renderer. The renderer inserts the Markdown code-fence language or info-string directly into the code element's class and data-lang attributes without HTML escaping. If an attacker crafts a fence info-string containing a quote and a script payload, it can break out of the attribute context and inject executable script code into the generated page. This vulnerability is addressed in version 0.163.3.
Potential Impact
An attacker can inject malicious scripts into pages generated by vulnerable Hugo versions, potentially leading to cross-site scripting attacks when users view the affected pages. This can result in execution of arbitrary scripts in the context of the site, impacting confidentiality and integrity of user interactions. The CVSS 4.0 base score is 5.1 (medium severity), reflecting network attack vector, low complexity, and limited privileges required.
Mitigation Recommendations
Upgrade to Hugo version 0.163.3 or later, where this vulnerability is fixed by properly escaping the code-fence language/info-string before inserting it into HTML attributes. No other mitigation or temporary workaround is indicated in the available data.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-06-30T18:19:58.378Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a4c076a27e9c7971920cc1d
Added to database: 07/06/2026, 19:52:10 UTC
Last enriched: 07/06/2026, 20:06:47 UTC
Last updated: 07/06/2026, 20:11:22 UTC
Views: 5
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.