# CVE-2026-58402: Hugo default code block renderer XSS via unescaped code-fence language

- Priority: **Routine**
- Reason: Not severe (CVSS 5.1, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2026-07-06 · Modified: 2026-07-06
- Aliases: UBUNTU-CVE-2026-58402, DEBIAN-CVE-2026-58402, GHSA-q76j-gcg9-vxc6, GO-2026-5569
- Record: https://cvemate.com/vulnerability/CVE-2026-58402 · JSON: https://cvemate.com/vulnerability/CVE-2026-58402/json

## Description

```text
Hugo is a static site generator. From 0.60.0 until 0.163.3, Hugo's default code-block renderer wrote the Markdown code-fence language or info-string into the code class="language-…" data-lang="…" wrapper without HTML escaping. A fence info-string containing a quote and a script payload breaks out of the attribute and injects a live script element. This issue is fixed in 0.163.3.
```

## Signals

- CVSS: 5.4 medium (v3.1, NVD) CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
- EPSS: 0.172%, percentile 6.893%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- debian hugo (Debian): All versions (No fix recorded) \| \< 0.165.0-1
- ubuntu hugo (Ubuntu): All versions (No fix recorded)
- gohugo hugo: ≥ 0.60.0, \< 0.163.3
- gohugoio hugo: ≥ 0.60.0, \< 0.163.3
- github.com/gohugoio hugo (Go): ≥ 0.60.0, \< 0.163.3

## References

- <https://github.com/gohugoio/hugo/security/advisories/GHSA-q76j-gcg9-vxc6>
- <https://github.com/gohugoio/hugo/pull/15051>
- <https://github.com/gohugoio/hugo/commit/ce1a7e0bce3713af40496ded3c2c0ceeed49231d>
- <https://github.com/gohugoio/hugo/releases/tag/v0.163.3>
- <https://ubuntu.com/security/CVE-2026-58402>
- <https://www.cve.org/CVERecord?id=CVE-2026-58402>
- <https://security-tracker.debian.org/tracker/CVE-2026-58402>
- <https://github.com/gohugoio/hugo>

---

Data as of 2026-12-05T13:03:20.439Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
