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

- Priority: **Routine**
- Reason: Not severe (CVSS 4.8, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2026-08-24 · Modified: 2026-08-26
- Aliases: UBUNTU-CVE-2026-10618, DEBIAN-CVE-2026-10618
- Record: https://cvemate.com/vulnerability/CVE-2026-10618 · JSON: https://cvemate.com/vulnerability/CVE-2026-10618/json

## Description

```text
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.
```

## Signals

- CVSS: 5.4 medium (v3.1, CVE.org) CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
- EPSS: 0.215%, percentile 12.619%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- debian hugo (Debian): All versions (No fix recorded) \| \< 0.166.0-1
- ubuntu hugo (Ubuntu): All versions (No fix recorded)
- gohugo hugo: ≥ 0.93.0, \< 0.165.0
- gohugoio hugo: ≥ 0.93.0, ≤ 0.165.0

## 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>
- <https://ubuntu.com/security/CVE-2026-10618>
- <https://www.cve.org/CVERecord?id=CVE-2026-10618>
- <https://security-tracker.debian.org/tracker/CVE-2026-10618>

---

Data as of 2026-12-05T10:25:25.836Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
