What’s Vulnerable › Vulnerabilities
CVE-2026-100691: Hugo before 0.166.0 Stored XSS via lineAnchors code block option
- Severity: medium (CVSS 5.4 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.2% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2026-09-26 · updated 2026-09-29
- Weakness: CWE-79
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
- gohugoio hugo: from 0.75.0 before 0.166.0 — fixed in 0.166.0
How to fix
Upgrade to a fixed version: gohugoio hugo 0.166.0. Check the vendor advisory for mitigations.
References
- https://github.com/gohugoio/hugo/security/advisories/GHSA-q4xf-287f-98r8
- https://www.vulncheck.com/advisories/hugo-before-0.166.0-stored-xss-via-lineanchors-code-block-option
Get alerted when CVE-2026-100691 or the next vulnerability affects your stack