5.1medium
Hugo default code block renderer XSS via unescaped code-fence language
- Severity
- 5.1medium CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.30% (higher than 15% of CVEs)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-q76j-gcg9-vxc6GO-2026-5569
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
| Product or package | Versions | Reported by |
|---|---|---|
| gohugoio hugo | >= 0.60.0, < 0.163.3 | CVE List |
| github.com/gohugoio/hugo (Go) | from 0.60.0 before 0.163.3 | GitHub Advisory Database, Go Vulnerability Database |
| gohugo hugo | from 0.60.0 before 0.163.3 | NVD |
All scores
| GitHub_M | 5.1medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N |
| NVD | 5.4medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
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.
GitHub Advisory Database
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.
Go Vulnerability Database
Hugo: XSS via unescaped code-fence language in default code block renderer in github.com/gohugoio/hugo
NVD (es)
Hugo es un generador de sitios estáticos. Desde la versión 0.60.0 hasta la 0.163.3, el renderizador de bloques de código predeterminado de Hugo escribía el lenguaje de la valla de código Markdown o la cadena de información en el contenedor code class=“language-...” data-lang=“...” sin escape HTML. Una cadena de información de valla que contiene una comilla y una carga útil de script escapa del atributo e inyecta un elemento de script activo. Este problema se solucionó en la versión 0.163.3.
References
| https://github.com/gohugoio/hugo/security/advisories/GHSA-q76j-gcg9-vxc6 | advisory, vendor-advisory, web | |
| https://github.com/gohugoio/hugo/pull/15051 | issue-tracking | |
| https://github.com/gohugoio/hugo/commit/ce1a7e0bce3713af40496ded3c2c0ceeed49231d | fix, patch | |
| https://github.com/gohugoio/hugo/releases/tag/v0.163.3 | release-notes | |
| https://github.com/gohugoio/hugo | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-58402 changed 2026-07-06 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-q76j-gcg9-vxc6 changed 2026-07-24 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2026-5569 changed 2026-07-24 | CC-BY-4.0 |
| NVD | CVE-2026-58402 changed 2026-10-25 | Public domain |