XSS in Gohugo Hugo

CVE-2026-58402

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.

Vulnerability class: XSS (Cross-Site Scripting)

EPSS: 0.002 (7.0th percentile) — read the EPSS interpretation.

CVSS v3 metric

CVSS v3 base score 5.4 (Medium). Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N.

Affected products

Weakness classification (CWE)

References

Frequently asked questions

What is CVE-2026-58402?
CVE-2026-58402 is a medium-severity vulnerability in Gohugo Hugo, classified under Cross-site Scripting. CVSS score: 5.4/10. Published 2026-07-06.
How severe is CVE-2026-58402?
Medium severity. CVSS v3 base score is 5.4 out of 10.