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

- Severity: Medium 5.1 (CVSS:4.0, scored by GitHub_M) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.30%, higher than 15% of CVEs (2026-11-30)
- Published: 2026-06-19T17:45:27.000Z
- Modified: 2026-10-25T20:10:00.147Z
- Also known as: GHSA-q76j-gcg9-vxc6, GO-2026-5569
- Weaknesses: CWE-79
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- 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.

(As written by CVE List.)

## Affected

- gohugoio hugo: >= 0.60.0, < 0.163.3
- github.com/gohugoio/hugo (Go): from 0.60.0 before 0.163.3
- gohugo hugo: from 0.60.0 before 0.163.3

## Every score

- GitHub_M: CVSS:4.0 5.1 Medium `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: CVSS:4.0 Medium `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: CVSS:3.1 5.4 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N`

## 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

- CVE List: [CVE-2026-58402](https://www.cve.org/CVERecord?id=CVE-2026-58402), CVE Terms of Use, modified 2026-07-06
- GitHub Advisory Database: [GHSA-q76j-gcg9-vxc6](https://github.com/advisories/GHSA-q76j-gcg9-vxc6), CC-BY-4.0, modified 2026-07-24
- Go Vulnerability Database: [GO-2026-5569](https://pkg.go.dev/vuln/GO-2026-5569), CC-BY-4.0, modified 2026-07-24
- NVD: [CVE-2026-58402](https://nvd.nist.gov/vuln/detail/CVE-2026-58402), Public domain, modified 2026-10-25

---

Page: https://cve.day/CVE-2026-58402 · Whole record: https://cve.day/CVE-2026-58402.json · Rebuilt by cve.day 2026-11-25T22:59:27.245Z
