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.

Severity (CVSS 3.1)5.4Medium
Exploit odds (30 days)0.3%top 77.0% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

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

EcosystemPackageFixed inAdvisory
Debian:12hugono fix listedDEBIAN-CVE-2026-10618
Debian:13hugono fix listedDEBIAN-CVE-2026-10618
Debian:14hugo0.166.0-1DEBIAN-CVE-2026-10618
Ubuntu:22.04:LTShugono fix listedUBUNTU-CVE-2026-10618
Ubuntu:26.04:LTShugono fix listedUBUNTU-CVE-2026-10618
Ubuntu:26.10hugono fix listedUBUNTU-CVE-2026-10618

Affected products (as reported)

VendorProductVersions
gohugoio hugo 0.93.0 – through 0.165.0

Weakness: CWE-79 · Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N

References