CVE-2026-10618: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in gohugoio hugo
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.
AI Analysis
Technical Summary
Hugo's default fenced-code-block renderer converts attribute values from code-fence info strings into strings without escaping them, contrary to the function documentation. The RenderAttributes function only escapes byte slice values, but since values are stored as strings, escaping is never applied. This allows an attacker to inject a quote character inside an attribute value, terminating the attribute early and enabling injection of additional attributes such as event handlers on the wrapper element. The vulnerability is exploitable under default configuration with code fences enabled and without enabling goldmark's unsafe setting or custom render hooks. Attribute names starting with 'on' are filtered, so the injection vector is through attribute values rather than names.
Potential Impact
An attacker can inject malicious script code into pages generated by Hugo, which executes in the browsers of visitors loading the affected pages. This cross-site scripting vulnerability can lead to client-side code execution, potentially resulting in session hijacking, defacement, or other malicious actions depending on the context of the site. The impact is limited to sites using the vulnerable Hugo versions with default code fence rendering enabled.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, consider disabling fenced-code-block rendering or using custom render hooks to sanitize attribute values. Avoid enabling goldmark's unsafe setting unless necessary and with caution. Monitor official Hugo channels for updates addressing this vulnerability.
CVE-2026-10618: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in gohugoio hugo
Description
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.
CVSS v4.0
Score 4.8medium
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Hugo's default fenced-code-block renderer converts attribute values from code-fence info strings into strings without escaping them, contrary to the function documentation. The RenderAttributes function only escapes byte slice values, but since values are stored as strings, escaping is never applied. This allows an attacker to inject a quote character inside an attribute value, terminating the attribute early and enabling injection of additional attributes such as event handlers on the wrapper element. The vulnerability is exploitable under default configuration with code fences enabled and without enabling goldmark's unsafe setting or custom render hooks. Attribute names starting with 'on' are filtered, so the injection vector is through attribute values rather than names.
Potential Impact
An attacker can inject malicious script code into pages generated by Hugo, which executes in the browsers of visitors loading the affected pages. This cross-site scripting vulnerability can lead to client-side code execution, potentially resulting in session hijacking, defacement, or other malicious actions depending on the context of the site. The impact is limited to sites using the vulnerable Hugo versions with default code fence rendering enabled.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, consider disabling fenced-code-block rendering or using custom render hooks to sanitize attribute values. Avoid enabling goldmark's unsafe setting unless necessary and with caution. Monitor official Hugo channels for updates addressing this vulnerability.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-06-02T13:53:48.666Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a8c261eacd9273b496b635d
Added to database: 08/24/2026, 11:08:14 UTC
Last enriched: 08/24/2026, 11:09:38 UTC
Last updated: 08/24/2026, 13:38:23 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.