Skip to main content
VulnerabilityPublished

github.com/gohugoio/hugo · Hugo highlight wrapperClass option allows stored cross-site scripting

Affects github.com/gohugoio/hugoSource GCVE Database

0

CVSS 4.6 Medium : upgrade to 0.170.0 when convenient.

Data as of 1 Dec 2026, 04:17 UTC

CVSS 4.0 base score
4.6Medium
How severe the flaw is on the 0–10 CVSS scale.
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:N

What to do

Upgrade github.com/gohugoio/hugo to 0.170.0.

Affected software

ProductAffectedFixed in
Gogithub.com/gohugoio/hugoAffected
  • >=0.140.2 <0.170.0
Fixed in
  • 0.170.0

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

Community reviews

Loading reviews…