Skip to content
OpenAdvisories
Medium · 5.1 CVE-2026-58402 EUVD-2026-41904GHSA-q76j-gcg9-vxc6GO-2026-5569

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

Published Jul 6, 2026 · Updated Jul 6, 2026 · Assigned by GitHub_M

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.

Affected products

VendorProductAffectedFixed
gohugoio hugo >= 0.60.0, < 0.163.3 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 hugo 0.165.0-1 —
Debian 13 hugo No fix yet —
Debian 12 hugo No fix yet —
ReleasePackageFixed inAdvisory
Ubuntu 26.10 hugo No fix yet —
Ubuntu 26.04 LTS hugo No fix yet —
Ubuntu 25.10 hugo No fix yet —
Ubuntu 22.04 LTS hugo No fix yet —
Ubuntu 20.04 LTS hugo No fix yet —
Show 3 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu 18.04 LTS hugo No fix yet —
Ubuntu 16.04 LTS hugo No fix yet —
Ubuntu Pro 24.04 LTS hugo No fix yet —
ReleasePackageFixed inAdvisory
Red Hat Hardened Images 1 hugo 0.163.3-0.1.hum1 RHSA-2026:36862

Affected packages

EcosystemPackageAffectedFixedRecord
Go github.com/gohugoio/hugo >= 0.60.0, < 0.163.3 0.163.3 GHSA-q76j-gcg9-vxc6

Advisories 1

References