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.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| gohugoio | hugo | 0.140.2 – < 0.170.0 | 0.170.0 |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | hugo | No fix yet | — |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Red Hat Hardened Images 1 | hugo | 0.170.1-0.1.hum1 | RHSA-2026:104146 |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| Go | github.com/gohugoio/hugo | >= 0.140.2, < 0.170.0 | 0.170.0 | GHSA-4whp-jx7j-xvrm |
Advisories 1
- RHSA-2026:104146 Red Hat Security Advisory: Red Hat Hardened Images RPMs bug fix and enhancement update Red Hat Security Advisories (RHSA) · Dec 2, 2026
References
- GitHub Security Advisory (GHSA-4whp-jx7j-xvrm) vendor-advisory
- VulnCheck Advisory: Hugo 0.140.2 before 0.170.0 Stored XSS via highlight shortcode wrapperClass third-party-advisory