Home › CVE › JavaScript
CVE-2026-140394 — gohugoio hugo
One of 2 gohugoio hugo vulnerabilities published together by NVD: our article covers all of them.
JavaScriptWebVulnerabilitiesSummary
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.
Severity breakdown
Medium · 5.1
An attacker with a normal user account can exploit this over the network if a user views or visits something.
- Attack from
- the network (remotely)
- Attack complexity
- low (no special conditions)
- Special conditions
- none
- Login needed
- yes, a normal user account
- User action needed
- yes, a user must view or visit something
- Impact
- none
- Impact on other systems
- low on confidentiality and integrity, none on availability
Weakness
- CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected and fixed versions
| Product | Affected versions | Fixed in |
|---|---|---|
| gohugoio hugo | ≥ 0.140.2, < 0.170.0 | 0.170.0 |
References by type
Vendor advisories
Other references
Affected
- gohugoio hugo
What to do
- Follow the vendor advisory and the references below for fixed versions and workarounds.
Frequently asked questions
What is CVE-2026-140394?
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. Weakness type: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (CWE-79).
How severe is CVE-2026-140394?
CVE-2026-140394 has a CVSS 4.0 base score of 5.1 (medium), from the CNA (vulncheck.com). An attacker with a normal user account can exploit this over the network if a user views or visits something.
Is CVE-2026-140394 being exploited?
Not as far as is known: CVE-2026-140394 is not in CISA's Known Exploited Vulnerabilities catalog as of December 3, 2026. EPSS estimates a 0.4% chance that it is exploited in the next 30 days.
Which versions are affected by CVE-2026-140394?
gohugoio hugo ≥ 0.140.2, < 0.170.0 (fixed in 0.170.0).
How do I fix CVE-2026-140394?
Update to a fixed release: gohugoio hugo 0.170.0.