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

- Severity: Medium 4.8 (CVSS:4.0, scored by VulnCheck) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.21%, higher than 12% of CVEs (2026-12-01)
- Published: 2026-08-24T10:29:10.191Z
- Modified: 2026-10-12T15:10:00.207Z
- Weaknesses: CWE-79
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: 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.

(As written by CVE List.)

## Affected

- gohugoio hugo: from 0.93.0 up to 0.165.0
- gohugo hugo: from 0.93.0 before 0.165.0

## Every score

- VulnCheck: CVSS:4.0 4.8 Medium `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`
- VulnCheck: CVSS:3.1 5.4 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N`

## References

- <https://github.com/gohugoio/hugo> (product)
- <https://github.com/gohugoio/hugo/blob/v0.165.0/markup/internal/attributes/attributes.go> (product, technical-description)
- <https://github.com/gohugoio/hugo/blob/v0.165.0/markup/goldmark/codeblocks/render.go> (product, technical-description)
- <https://github.com/gohugoio/hugo/blob/v0.165.0/markup/highlight/highlight.go> (product, technical-description)
- <https://www.vulncheck.com/advisories/hugo-through-stored-cross-site-scripting-via-unescaped-code-fence-attribute-values> (third-party-advisory)

## Sources

- CVE List: [CVE-2026-10618](https://www.cve.org/CVERecord?id=CVE-2026-10618), CVE Terms of Use, modified 2026-08-26
- NVD: [CVE-2026-10618](https://nvd.nist.gov/vuln/detail/CVE-2026-10618), Public domain, modified 2026-10-12

---

Page: https://cve.day/CVE-2026-10618 · Whole record: https://cve.day/CVE-2026-10618.json · Rebuilt by cve.day 2026-11-25T22:59:34.993Z
