# CVE-2026-140394: Hugo 0.140.2 before 0.170.0 Stored XSS via highlight shortcode wrapperClass

- Severity: Medium 5.1 (CVSS:4.0, scored by VulnCheck) `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
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-12-01T02:24:46.000Z
- Modified: 2026-12-01T16:18:19.697Z
- Also known as: GHSA-4whp-jx7j-xvrm
- Weaknesses: CWE-79
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: VulnCheck

## Description

Hugo after 0.140.2 and before 0.170.0 contains a stored cross-site scripting vulnerability in the highlight shortcode and transform.Highlight template function, which write the wrapperClass option unescaped into the wrapping div's class attribute. Content authors can supply a wrapperClass value that closes the attribute and appends a script element, executing JavaScript in visitors' browsers under the site's origin.

(As written by CVE List.)

## Affected

- gohugoio hugo: from 0.140.2 before 0.170.0 (not affected: 0.170.0)
- github.com/gohugoio/hugo (Go): from 0.140.2 before 0.170.0

## Every score

- VulnCheck: 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`
- VulnCheck: 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`
- GitHub: CVSS:4.0 Medium `CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N`

## References

- <https://github.com/gohugoio/hugo/security/advisories/GHSA-4whp-jx7j-xvrm> (exploit, vendor-advisory, web)
- <https://www.vulncheck.com/advisories/hugo-0.140.2-before-0.170.0-stored-xss-via-highlight-shortcode-wrapperclass> (third-party-advisory)
- <https://github.com/gohugoio/hugo/pull/15564> (web)
- <https://github.com/gohugoio/hugo/commit/bdde5aa5155c6c349a743e71dc846bef754b6773> (web)
- <https://github.com/gohugoio/hugo> (package)
- <https://github.com/gohugoio/hugo/releases/tag/v0.170.0> (web)

## Sources

- CVE List: [CVE-2026-140394](https://www.cve.org/CVERecord?id=CVE-2026-140394), CVE Terms of Use, modified 2026-12-01
- GitHub Advisory Database: [GHSA-4whp-jx7j-xvrm](https://github.com/advisories/GHSA-4whp-jx7j-xvrm), CC-BY-4.0, modified 2026-12-01
- NVD: [CVE-2026-140394](https://nvd.nist.gov/vuln/detail/CVE-2026-140394), Public domain, modified 2026-12-01

---

Page: https://cve.day/CVE-2026-140394 · Whole record: https://cve.day/CVE-2026-140394.json · Rebuilt by cve.day 2026-12-01T16:32:19.030Z
