Skip to content
OpenAdvisories
Medium · 5.4 CVE-2026-140394 EUVD-2026-140249GHSA-332r-53xh-x52jGHSA-4whp-jx7j-xvrm

Hugo 0.140.2 before 0.170.0 Stored XSS via highlight shortcode wrapperClass

Published Dec 1, 2026 · Updated Dec 1, 2026 · 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.

Affected products

VendorProductAffectedFixed
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.

ReleasePackageFixed inAdvisory
Debian 14 hugo No fix yet —
ReleasePackageFixed inAdvisory
Red Hat Hardened Images 1 hugo 0.170.1-0.1.hum1 RHSA-2026:104146

Affected packages

EcosystemPackageAffectedFixedRecord
Go github.com/gohugoio/hugo >= 0.140.2, < 0.170.0 0.170.0 GHSA-4whp-jx7j-xvrm

Advisories 1

References