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

Published Jul 6, 2026
·
Updated

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.

Affected Software

2 affected components
Hugo Hugo>=0.60.0<0.163.3
gohugo Hugo>=0.60.0<0.163.3

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 0.163.3

Event History

Jul 6, 2026
CVE Published
via MITRE·07:19 PM
Data Sourced
via MITRE·07:19 PM
DescriptionWeakness
Data Sourced
via NVD·08:16 PM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-58402?

The severity of CVE-2026-58402 is classified as medium with a score of 5.1.

2

How do I fix CVE-2026-58402?

To fix CVE-2026-58402, upgrade Hugo to version 0.163.4 or later.

3

What does CVE-2026-58402 exploit?

CVE-2026-58402 exploits a cross-site scripting (XSS) vulnerability in Hugo's default code block renderer.

4

Which versions of Hugo are affected by CVE-2026-58402?

CVE-2026-58402 affects Hugo versions from 0.60.0 to 0.163.3.

5

What type of vulnerability is CVE-2026-58402?

CVE-2026-58402 is classified as an XSS vulnerability.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203