CVE-2026-58402 PUBLISHED

Hugo default code block renderer XSS via unescaped code-fence language

Assigner: GitHub_M
Reserved: 30.06.2026 Published: 06.07.2026 Updated: 06.07.2026

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.

Metrics

CVSS 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
CVSS Score: 5.1

Product Status

Vendor gohugoio
Product hugo
Versions
  • Version >= 0.60.0, < 0.163.3 is affected

References

Problem Types

  • CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') CWE