Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-58402: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in gohugoio hugo

0
Medium
VulnerabilityCVE-2026-58402cvecve-2026-58402cwe-79
Published: 07/06/2026 (07/06/2026, 19:19:58 UTC)
Source: CVE Database V5
Vendor/Project: gohugoio
Product: hugo

Description

A cross-site scripting (XSS) vulnerability exists in the Hugo static site generator's default code-block renderer from versions 0.60.0 up to 0.163.3. The vulnerability occurs because the Markdown code-fence language or info-string is written into HTML attributes without proper escaping, allowing injection of malicious scripts. This issue is fixed starting in version 0.163.3.

CVSS v4.0

Score 5.1medium

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
Low
User Interaction
Passive
Vuln. Confidentiality
None
Vuln. Integrity
None
Vuln. Availability
None
Subsq. Confidentiality
Low
Subsq. Integrity
Low
Subsq. Availability
None
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N

Affected software

github.com/gohugoio/hugo
pkg:golang/github.com/gohugoio/hugo
Affected versions
>=0.60.0 <=0.163.2

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/06/2026, 20:06:47 UTC

Technical Analysis

Hugo versions from 0.60.0 until 0.163.3 have an XSS vulnerability (CWE-79) in the default code-block renderer. The renderer inserts the Markdown code-fence language or info-string directly into the code element's class and data-lang attributes without HTML escaping. If an attacker crafts a fence info-string containing a quote and a script payload, it can break out of the attribute context and inject executable script code into the generated page. This vulnerability is addressed in version 0.163.3.

Potential Impact

An attacker can inject malicious scripts into pages generated by vulnerable Hugo versions, potentially leading to cross-site scripting attacks when users view the affected pages. This can result in execution of arbitrary scripts in the context of the site, impacting confidentiality and integrity of user interactions. The CVSS 4.0 base score is 5.1 (medium severity), reflecting network attack vector, low complexity, and limited privileges required.

Mitigation Recommendations

Upgrade to Hugo version 0.163.3 or later, where this vulnerability is fixed by properly escaping the code-fence language/info-string before inserting it into HTML attributes. No other mitigation or temporary workaround is indicated in the available data.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-06-30T18:19:58.378Z
Cvss Version
4.0
State
PUBLISHED
Remediation Level
null

Threat ID: 6a4c076a27e9c7971920cc1d

Added to database: 07/06/2026, 19:52:10 UTC

Last enriched: 07/06/2026, 20:06:47 UTC

Last updated: 07/06/2026, 20:11:22 UTC

Views: 5

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses