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.
Published: 2026-09-26
Score: 5.1 Medium
EPSS: < 1% Very Low
KEV: No
Impact: Arbitrary JavaScript execution via stored XSS
Action: Patch Immediately
AI Analysis

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.

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

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 yet.

History

Tue, 29 Sep 2026 13:15:00 +0000

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


Mon, 28 Sep 2026 18:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Sat, 26 Sep 2026 13:30:00 +0000

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'}


cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-09-28T17:51:34.652Z

Reserved: 2026-09-26T02:37:41.037Z

Link: CVE-2026-100691

cve-icon Vulnrichment

Updated: 2026-09-28T17:51:26.171Z

cve-icon NVD

Status : Analyzed

Published: 2026-09-26T14:16:53.710

Modified: 2026-09-29T19:08:14.347

Link: CVE-2026-100691

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-09-26T13:23:50Z

Links: CVE-2026-100691 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-09-26T16:45:14Z

Weaknesses
  • CWE-79

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