github.com/gohugoio/hugo · Hugo highlight wrapperClass option allows stored cross-site scripting
Affects github.com/gohugoio/hugoSource GCVE Database
CVSS 4.6 Medium : upgrade to 0.170.0 when convenient.
Data as of 1 Dec 2026, 04:17 UTC
- Patch
- Available – fixed in 0.170.0
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:L/VA:N/SC:L/SI:L/SA:NWhat to do
Upgrade github.com/gohugoio/hugo to 0.170.0.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| Gogithub.com/gohugoio/hugo | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
Upgrade Hugo to version 0.170.0 or later, where the wrapperClass option is properly HTML-escaped to prevent XSS. Since a patch is available and fixed in 0.170.0, applying this official fix is the recommended remediation. No additional mitigations are specified or required if the patch is applied.
Description
The Hugo static site generator's built-in highlight shortcode has a stored cross-site scripting (XSS) vulnerability due to improper handling of the wrapperClass option. This option is written unescaped into a div's class attribute, allowing malicious content authors to inject arbitrary HTML or JavaScript. The vulnerability affects versions from 0.140.2 up to but not including 0.170.0 and is fixed in version 0.170.0.
References
- github.com/gohugoio/hugo/security/advisories/GHSA-4whp-jx7j-xvrm (opens in a new tab)
- github.com/gohugoio/hugo/pull/15564 (opens in a new tab)
- github.com/gohugoio/hugo/commit/bdde5aa5155c6c349a743e71dc846bef754b6773 (opens in a new tab)
- github.com/gohugoio/hugo (opens in a new tab)
- github.com/gohugoio/hugo/releases/tag/v0.170.0 (opens in a new tab)