Vulnerability · Published Aug 24, 2026 · Assigned by VulnCheck
CVE-2026-10618Hugo 0.93.0 through 0.165.0 Stored Cross-Site Scripting via Unescaped Code-Fence Attribute Values
Medium 5.4
In plain English
A medium-severity cross-site scripting in hugo from gohugoio. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.3% (higher than 23% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official 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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | hugo | no fix listed | DEBIAN-CVE-2026-10618 |
| Debian:13 | hugo | no fix listed | DEBIAN-CVE-2026-10618 |
| Debian:14 | hugo | 0.166.0-1 | DEBIAN-CVE-2026-10618 |
| Ubuntu:22.04:LTS | hugo | no fix listed | UBUNTU-CVE-2026-10618 |
| Ubuntu:26.04:LTS | hugo | no fix listed | UBUNTU-CVE-2026-10618 |
| Ubuntu:26.10 | hugo | no fix listed | UBUNTU-CVE-2026-10618 |
Affected products (as reported)
Weakness: CWE-79 · Vector: 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 technical-description
- https://github.com/gohugoio/hugo/blob/v0.165.0/markup/goldmark/codeblocks/render.go technical-description
- https://github.com/gohugoio/hugo/blob/v0.165.0/markup/highlight/highlight.go technical-description
- VulnCheck Advisory: Hugo 0.93.0 through 0.165.0 Stored Cross-Site Scripting via Unescaped Code-Fence Attribute Values third-party-advisory