CWE data temporarily unavailableCWE data is currently experiencing intermittent outages, which may cause incomplete section loading on CVE pages. We are actively working on a fix.

CVE-2026-10618

Description

A flaw was found in Hugo's default fenced-code-block renderer. This vulnerability allows a remote attacker to inject arbitrary script code into the rendered HTML by providing specially crafted input in the code-fence info string. Due to improper escaping of attribute values, a malicious quote can terminate an attribute and allow the injection of additional attributes, including event handlers. This can lead to client-side arbitrary code execution when a user views the affected page.

Statement

A flaw was found in Hugo. The default fenced-code-block renderer writes attribute values from the code-fence info string into HTML without escaping them. A crafted quote character inside an attribute value terminates the attribute in the rendered HTML, allowing injection of additional attributes including event handlers. The injected script executes for every visitor who loads the page. This is exploitable under the default Hugo configuration with code fences enabled, without requiring the goldmark unsafe setting or any custom render hook. Note that attribute names beginning with 'on' are filtered during parsing, but injection is achieved through the attribute value rather than the name.

Mitigation

Update to a fixed version of Hugo. As a workaround, disable code-fence attribute support in the goldmark configuration by setting markup.highlight.codeFences to false, or use a custom render hook that explicitly escapes attribute values before writing them to HTML output.

Common Vulnerability Scoring System (CVSS) Score Details

Info alert:Important note

CVSS scores for open source components depend on vendor-specific factors (e.g. version or build chain). Therefore, Red Hat's score and impact rating can be different from NVD and other vendors. Red Hat remains the authoritative CVE Naming Authority (CNA) source for its products and services (see Red Hat classifications).

CVSS v3 Score Breakdown

Red HatNVDcve.org
Base Score5.4N/A5.4
Attack VectorNetworkN/ANetwork
Attack ComplexityLowN/ALow
Privileges RequiredLowN/ALow
User InteractionRequiredN/ARequired
ScopeChangedN/AChanged
ConfidentialityLowN/ALow
Integrity ImpactLowN/ALow
Availability ImpactNoneN/ANone

Vector

Red Hat: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N

cve.org: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N

Frequently Asked Questions

Want to get errata notifications? Sign up here.