CVE-2026-58402: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in gohugoio hugo
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.
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
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.
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: 08/19/2026, 22:52:13 UTC
Views: 120
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.