๐Ÿ” CVE Alert

CVE-2026-10618

MEDIUM 5.4

Hugo 0.93.0 through 0.165.0 Stored Cross-Site Scripting via Unescaped Code-Fence Attribute Values

CVSS Score
5.4
EPSS Score
0.0%
EPSS Percentile
0th

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.

CWE CWE-79
Vendor gohugoio
Product hugo
Published Aug 24, 2026
Last Updated Aug 24, 2026
Stay Ahead of the Next One

Get instant alerts for gohugoio hugo

Be the first to know when new medium vulnerabilities affecting gohugoio hugo are published โ€” delivered to Slack, Telegram or Discord.

Get Free Alerts โ†’ Free ยท No credit card ยท 60 sec setup

CVSS v3 Breakdown

CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

Affected Versions

gohugoio / hugo
0.93.0 โ‰ค 0.165.0

References

NVD โ†— CVE.org โ†— EPSS Data โ†—
github.com: https://github.com/gohugoio/hugo github.com: https://github.com/gohugoio/hugo/blob/v0.165.0/markup/internal/attributes/attributes.go github.com: https://github.com/gohugoio/hugo/blob/v0.165.0/markup/goldmark/codeblocks/render.go github.com: https://github.com/gohugoio/hugo/blob/v0.165.0/markup/highlight/highlight.go vulncheck.com: https://www.vulncheck.com/advisories/hugo-through-stored-cross-site-scripting-via-unescaped-code-fence-attribute-values

Credits

Michael Holmquist