CVE-2026-10618Hugo 0.93.0 through 0.165.0 Stored Cross-Site Scripting via Unescaped Code-Fence Attribute Values
Updated under an hour ago ()
Does this affect you?
It affects gohugoio hugo and 1 other product. Add what you run to find out whether that includes you.
No exploitation reported and no EPSS estimate yet.
Do this next
Free account, 1 product
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
- 5.4 MEDIUM (v3.1, CNA)CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
- Weakness (CWE)
- CWE-79
- Known exploited
- Not in CISA's KEV catalog
- EPSS (exploitation in the next 30 days)
- Not loaded for this CVE
- Assigned by
- VulnCheck
- NVD analysis
- Analyzed
- Record last updated
- Aug 26, 2026
- First seen by InfoSec Signals
- Oct 9, 2026
Affected products
gohugoio hugo gohugoio:hugo (from the name) | from 0.93.0 through 0.165.0 | CNA record |
gohugo hugo gohugo:hugo | from 0.93.0 before 0.165.0 | NVD |
References
- https://github.com/gohugoio/hugoproduct
- https://github.com/gohugoio/hugo/blob/v0.165.0/markup/internal/attributes/attributes.gotechnical-description, product
- https://github.com/gohugoio/hugo/blob/v0.165.0/markup/goldmark/codeblocks/render.gotechnical-description, product
- https://github.com/gohugoio/hugo/blob/v0.165.0/markup/highlight/highlight.gotechnical-description, product
- https://www.vulncheck.com/advisories/hugo-through-stored-cross-site-scripting-via-unescaped-code-fence-attribute-valuesthird-party-advisory
The CVE record on cve.org NVD's entry
The CVE record is authoritative. Products marked “from the name” were identified from the CNA's free-text names, not a CPE, and are matched less certainly. This product uses the NVD API but is not endorsed or certified by the NVD.