Hugo: XSS via unescaped code-fence language in default code block renderer
Key facts
- Attack vector
- —
- Privileges required
- —
- User interaction
- —
- Attack complexity
- —
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- —
- Fix status
- Fixed
No CVSS vector from any source. Fix status from GitHub. Impact type from CWE-79.
Summary
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.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | github.com/gohugoio/hugo (Go) | 0.60.0 to before 0.163.3 | 0.163.3 | Patch available | GHSA-q76j-gcg9-vxc6 |
- github.com/gohugoio/hugo (Go) Vendor— Affected 0.60.0 to before 0.163.3 Fixed in 0.163.3 Patch available GHSA-q76j-gcg9-vxc6
Remediation
- Fix · GHSA-q76j-gcg9-vxc6 github.com/gohugoio/hugo (Go) Fixed in 0.163.3 Advisory →
Timeline
- 2026-10-03 Threatist record created from GHSA-q76j-gcg9-vxc6
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences