Skip to content
CVE PROGRAM SOURCE RECORD5.1 Medium

CVE-2026-100691

Hugo before 0.166.0 Stored XSS via lineAnchors code block option

Description

Hugo versions 0.75.0 through 0.165.x contain a stored cross-site scripting vulnerability: the syntax highlighter does not escape the `lineAnchors` option before passing it to Chroma, which writes the value verbatim into the `id` and `href` attributes of the generated line-number markup. A crafted `lineAnchors` value supplied as a Markdown code fence attribute (or passed to the `highlight` template function) results in unescaped HTML in the rendered page, allowing arbitrary JavaScript to execute in the browsers of visitors to the generated site. This affects sites that build and publish Markdown from untrusted contributors; Hugo's security model otherwise considers content trusted input. Fixed in 0.166.0, where the `lineAnchors` value is HTML-escaped before being passed to Chroma.

Affected products

Version statuses are supplied by the assigning organization. Consult the original record for detailed ranges and platform conditions.

gohugoio hugo

Default version status: unaffected

  • 0.75.0 to < 0.166.0affected
  • 0.166.0unaffected
pkg:golang/github.com/gohugoio/hugo

References