Advisory

GHSA-q76j-gcg9-vxc6

Also known as: CVE-2026-58402, GO-2026-5569

Summary

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

Details

Hugo's default code-block renderer wrote the Markdown code-fence language / 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 is not an issue if you fully trust every file under /content and every content adapter you load.

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2026-06-19 17:45 UTC
Modified
2026-07-24 19:11 UTC

Affected packages and fixes

github.com/gohugoio/hugo

Go · All systems

Affected

  • introduced 0.60.0, fixed 0.163.3 (semver)

Fixed versions

0.163.3

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences