All vulnerabilities
CVE-2026-100691GHSA-q4xf-287f-98r8

Hugo before 0.166.0 Stored XSS via lineAnchors code block option

gohugoio hugo
CVSS
5.1Medium
ExploitationNo known exploitationNot in CISA KEV, which does not prove it is unexploitedCISA KEV
Exploit odds (EPSS)0.17%Chance of exploitation activity in the next 30 days, higher than 6% of CVEs. Scored 23 Oct 2026FIRST EPSS
Fixed in0.166.0Fixed versionCVE List
Published26 Sep 2026Updated 28 Sep 2026CVE List

What fixes it

A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.

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.

Text from CVE List

Affected versions 2

  • hugoaffected: 0.75.0 before 0.166.0CVE List
  • hugounaffected: 0.166.0CVE List

References 2