CVE-2026-10618

NameCVE-2026-10618
DescriptionHugo'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.
SourceCVE (at NVD; CERT, ENISA, LWN, oss-sec, fulldisc, Debian ELTS, Red Hat, Ubuntu, Gentoo, SUSE bugzilla/CVE, GitHub advisories/code/issues, web search, more)
Debian Bugs1146720

Vulnerable and fixed packages

The table below lists information on source packages.

Source PackageReleaseVersionStatus
hugo (PTS)bookworm0.111.3-1vulnerable
trixie0.131.0-1vulnerable
forky, sid0.165.0-3vulnerable

The information below is based on the following data on fixed versions.

PackageTypeReleaseFixed VersionUrgencyOriginDebian Bugs
hugosource(unstable)(unfixed)1146720

Notes

[trixie] - hugo <no-dsa> (Minor issue)
https://github.com/gohugoio/hugo/issues/15247
https://github.com/gohugoio/hugo/commit/e4dc48cf7f8e06fc1e7e4c290dccc7c35d881c55

Search for package or bug name: Reporting problems