CVE-2026-10618
Received Received - Intake

Hugo Markup Attribute Injection Vulnerability

Vulnerability report for CVE-2026-10618, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-08-24

Last updated on: 2026-08-24

Assigner: VulnCheck

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 Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-08-24
Last Modified
2026-08-24
Generated
2026-08-24
AI Q&A
2026-08-24
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 2 associated CPEs
Vendor Product Version / Range
gohugoio hugo From 0.93.0 (inc) to 0.165.0 (inc)
gohugoio hugo 0.165.0

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-79 The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability in Hugo, a static site generator, involves improper handling of user-controlled input in code highlighting. The default fenced-code-block renderer writes attribute values from the code-fence info string directly into HTML without escaping them. This allows attackers to inject malicious scripts via crafted attribute values, enabling event handlers or additional attributes that execute scripts when the page is loaded.

Detection Guidance

Check Hugo version with 'hugo version' to see if it is below v0.165.0. Inspect rendered HTML output for code blocks with unescaped attributes, particularly those containing event handlers or scripts in attribute values.

Impact Analysis

This vulnerability can lead to stored cross-site scripting (XSS) attacks. If exploited, it allows arbitrary JavaScript execution in the context of a user's browser when viewing a specially crafted page. This could result in session hijacking, theft of sensitive data, or other malicious activities for every visitor who loads the affected page.

Compliance Impact

This vulnerability could lead to unauthorized access to user data, violating GDPR's data protection principles and HIPAA's security requirements for protected health information. Organizations using vulnerable Hugo versions may face compliance breaches, legal penalties, and reputational damage due to potential data exposure from XSS attacks.

Mitigation Strategies

Upgrade Hugo to the latest patched version. Disable code fences if not needed. Review and sanitize user-provided content, especially in code-fence info strings. Monitor for unusual script execution in page loads.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-10618. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart