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
- Gohugo Hugo
- Gohugoio Hugo — versions >= 0.60.0, < 0.163.3
Weakness classification (CWE)
References
- security-advisories@github.com (x_refsource_CONFIRM, Vendor Advisory)
- security-advisories@github.com (x_refsource_MISC, Issue Tracking)
- security-advisories@github.com (Patch, x_refsource_MISC)
- security-advisories@github.com (x_refsource_MISC, Release Notes)
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.