CVE-2026-10618
published medium CVSS 4.0 · 4.8Hugo 0.93.0 through 0.165.0 Stored Cross-Site Scripting via Unescaped Code-Fence Attribute Values
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| gohugoio | — | hugo0.93.0 through 0.165.0 · Other versions: unaffected | Affected | Not stated | VulnCheck |
Description
Hugo's default fenced-code-block renderer writes attribute values taken from the code-fence info string into the rendered HTML without escaping them. New in markup/internal/attributes/attributes.go converts every attribute value from a byte slice to a string as it is stored, deliberately dropping the escaping that used to happen there, and RenderAttributes in the same file escapes only values that are still byte slices, so its escaping branch is never reached and every value is written verbatim. The function's documentation states that it performs HTML escaping of string attributes, which it does not. A quote inside an attribute value in the info string therefore terminates the attribute and allows a further attribute, including an event handler, to be placed on the wrapper element, and the script runs for every visitor who loads the page. This path is reached under the default configuration, with code fences enabled and without goldmark's unsafe setting or any custom render hook. Attribute names beginning with on are filtered when the attributes are parsed, so injection is achieved through the value rather than the name.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 4.0
- Base score
- 4.8 / 10
- Severity
- medium
- Provider
- VulnCheck · cna
- Vector string
- CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:A/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N
Additional Assessments
| Version | Score | Severity | Provider | Vector | Scenarios |
|---|---|---|---|---|---|
| 3.1 | 5.4 | medium | VulnCheck · cna | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N | — |
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| gohugoio | hugo | 0.93.0 through 0.165.0 (affected · semver)Default: unaffected | VulnCheck · cna |
Weaknesses
1- CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
References
5- https://github.com/gohugoio/hugo
- https://github.com/gohugoio/hugo/blob/v0.165.0/markup/goldmark/codeblocks/render.go
- https://github.com/gohugoio/hugo/blob/v0.165.0/markup/highlight/highlight.go
- https://github.com/gohugoio/hugo/blob/v0.165.0/markup/internal/attributes/attributes.go
- VulnCheck Advisory: Hugo 0.93.0 through 0.165.0 Stored Cross-Site Scripting via Unescaped Code-Fence Attribute Values https://www.vulncheck.com/advisories/hugo-through-stored-cross-site-scripting-via-unescaped-code-fence-attribute-values
Provider assertions
2VulnCheck · cna
Hugo 0.93.0 through 0.165.0 Stored Cross-Site Scripting via Unescaped Code-Fence Attribute Values
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 797d46d8d5a5253bfc27d02ddd219096374a02d8fb3433ea61d2612d6377651e
- Ingested
- 23 Sep 2026, 09:00:12 UTC
- Source record
- Official CVE record