CVE-2026-100691

Hugo before 0.166.0 Stored XSS via lineAnchors code block option

Published Sep 26, 2026 CVSS 4.0 · 5.1 Medium EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical impact

The vulnerability is a stored cross‑site scripting flaw in Hugo versions 0.75.0 through 0.165.x. The syntax highlighter fails to 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 via the highlight template function) results in unescaped HTML in the rendered page, allowing an attacker to inject arbitrary JavaScript that runs in the browsers of visitors to the generated site. This flaw enables client‑side code execution for anyone who visits a page that contains the malicious code block.

Affected Systems

The affected product is the Hugo static site generator, available from gohugoio. Versions 0.75.0 through 0.165.x are impacted. Sites that build and publish Markdown from untrusted contributors are at risk, whereas content that is considered trusted by Hugo is not automatically affected. The fix is addressed in 0.166.0.

Risk and Exploitability

The CVSS base score is 5.1, indicating the flaw is of moderate severity from the perspective of the vendor. The EPSS score is not available, and the vulnerability is not listed in the CISA KEV catalog, suggesting that exploitation is not yet widespread. However, attackers who control content sources can exploit it by embedding a malicious lineAnchors attribute in a Markdown code fence, which is then rendered into the website and causes arbitrary JavaScript to execute in the browsers of visitors. Because the attack requires only content injection and no additional system access, the risk is significant for sites that accept untrusted input.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Hugo to version 0.166.0 or later, which sanitizes the lineAnchors option before passing it to Chroma.
  • If an upgrade is not immediately possible, configure the site to disable or remove the lineAnchors attribute for Markdown code fences or remotely sanitize all Markdown before processing.
  • Restrict Markdown content contributions to trusted users and validate incoming Markdown for unescaped attributes before publishing.

Generated by OpenCVE AI on September 26, 2026 at 16:13 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
First Time appeared Redhat
Redhat hummingbird
CPEs cpe:/a:redhat:hummingbird:1
Vendors & Products Redhat
Redhat hummingbird
References
Metrics threat_severity

None

threat_severity

Moderate

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
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.
Title Hugo before 0.166.0 Stored XSS via lineAnchors code block option
First Time appeared Gohugo
Gohugo hugo
Weaknesses CWE-79
CPEs cpe:2.3:a:gohugo:hugo:*:*:*:*:*:*:*:*
Vendors & Products Gohugo
Gohugo hugo
References
Metrics cvssV3_1

{'score': 5.4, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N'}

cvssV4_0

{'score': 5.1, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N'}

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Sep 28, 2026, 5:51 PM
Reserved
Sep 26, 2026, 2:37 AM
Status
Analyzed
Published
Sep 26, 2026, 2:16 PM
Modified
Sep 29, 2026, 7:08 PM
Severity
Moderate
Public date
Sep 26, 2026, 1:23 PM