Hugo highlight wrapperClass option allows stored cross-site scripting
Affected
| Package | Affected versions | Fixed in |
|---|---|---|
| go:github.com/gohugoio/hugo | >= 0.140.2, < 0.170.0 | 0.170.0 |
The wrapperClass option of the built-in highlight shortcode (and the transform.Highlight template function) was written unescaped into the wrapping , allowing a content author to inject arbitrary HTML/JavaScript into the rendered page. Details markup/highlight/highlight.go (writeDivStart) wrote wrapperClass directly between class=" and ", while all other attribute values were HTML-escaped. Because the shortcode's options string is decoded into the highlight config, any content author can set wr…
Read on GitHub Advisory Database
Get these alerts on XExploits, big breaches and outages, with what to do.
Follow @vulnpulse_appOn 12/01/2026, 11:24 AM, GitHub Advisory Database published "Hugo highlight wrapperClass option allows stored cross-site scripting" (type: Advisory). Severity is "Medium" (medium). Related technologies: Go, GitHub.