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.
Hugo before 0.166.0 Stored XSS via lineAnchors code block option
Problem type
Affected products
gohugoio
< 0.166.0 - AFFECTED
0.166.0 - UNAFFECTED
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
GitHub Security Advisories
GHSA-8v94-8989-vc79
Hugo versions 0.75.0 through 0.165.x contain a stored cross-site scripting vulnerability: the...
https://github.com/advisories/GHSA-8v94-8989-vc79Hugo 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.
https://github.com/gohugoio/hugo/security/advisories/GHSA-q4xf-287f-98r8
https://nvd.nist.gov/vuln/detail/CVE-2026-100691
https://www.vulncheck.com/advisories/hugo-before-0.166.0-stored-xss-via-lineanchors-code-block-option
https://github.com/advisories/GHSA-8v94-8989-vc79
JSON source
https://cveawg.mitre.org/api/cve/CVE-2026-100691Click to expand
{
"dataType": "CVE_RECORD",
"dataVersion": "5.2",
"cveMetadata": {
"cveId": "CVE-2026-100691",
"assignerOrgId": "83251b91-4cc7-4094-a5c7-464a1b83ea10",
"assignerShortName": "VulnCheck",
"dateUpdated": "2026-09-26T13:23:50.149Z",
"dateReserved": "2026-09-26T02:37:41.037Z",
"datePublished": "2026-09-26T13:23:50.149Z",
"state": "PUBLISHED"
},
"containers": {
"cna": {
"providerMetadata": {
"orgId": "83251b91-4cc7-4094-a5c7-464a1b83ea10",
"shortName": "VulnCheck",
"dateUpdated": "2026-09-26T13:23:50.149Z"
},
"datePublic": "2026-09-09T00:00:00.000Z",
"title": "Hugo before 0.166.0 Stored XSS via lineAnchors code block option",
"descriptions": [
{
"lang": "en",
"value": "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": [
{
"vendor": "gohugoio",
"product": "hugo",
"defaultStatus": "unaffected",
"versions": [
{
"version": "0.75.0",
"status": "affected",
"versionType": "semver",
"lessThan": "0.166.0"
},
{
"version": "0.166.0",
"status": "unaffected",
"versionType": "semver"
}
]
}
],
"problemTypes": [
{
"descriptions": [
{
"lang": "en",
"description": "Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')",
"cweId": "CWE-79",
"type": "CWE"
}
]
}
],
"references": [
{
"url": "https://github.com/gohugoio/hugo/security/advisories/GHSA-q4xf-287f-98r8",
"name": "GitHub Security Advisory (GHSA-q4xf-287f-98r8)",
"tags": [
"vendor-advisory"
]
},
{
"url": "https://www.vulncheck.com/advisories/hugo-before-0.166.0-stored-xss-via-lineanchors-code-block-option",
"name": "VulnCheck Advisory: Hugo before 0.166.0 Stored XSS via lineAnchors code block option",
"tags": [
"third-party-advisory"
]
}
],
"metrics": [
{
"format": "CVSS"
},
{
"format": "CVSS",
"cvssV3_1": {
"version": "3.1",
"vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N",
"attackVector": "NETWORK",
"attackComplexity": "LOW",
"privilegesRequired": "LOW",
"userInteraction": "REQUIRED",
"scope": "CHANGED",
"confidentialityImpact": "LOW",
"integrityImpact": "LOW",
"availabilityImpact": "NONE",
"baseScore": 5.4,
"baseSeverity": "MEDIUM"
}
}
],
"credits": [
{
"lang": "en",
"value": "DONG2209",
"type": "finder"
}
]
}
}
}