esm.sh CVE-2025-65026
CRITICALAttack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessPublish package with crafted CSS payload
-
DeliveryVictim app imports CSS via ?module
-
Exploitesm.sh embeds raw CSS in template literal
-
Execution${...} expression evaluates as JavaScript
-
ImpactXSS in browser or RCE in Electron
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Requires (1) the esm.sh ?module CSS-to-JavaScript conversion feature to be used, (2) attacker control over the CSS file content served - typically by publishing or compromising a package whose CSS contains a ${...} template-literal expression and no backtick character (the pre-patch code only JSON-escaped CSS that contained a backtick, leaving backtick-free CSS inserted raw), and (3) a victim application to import that CSS module (UI:R - the payload only fires on import). Limiting factors: exploitation is not a direct hit on the esm.sh service but depends on a victim choosing to import attacker-influenced CSS; impact severity depends on runtime - XSS in browsers versus full RCE in Electron; and only esm.sh versions prior to 136 are affected. |
| Impact | Signals conflict sharply. CVSS 3.1 is 9.6 Critical (AV:N/AC:L/PR:N/UI:R/S:C with full C/I/A impact) and a public exploit exists in the GHSA advisory, yet EPSS is only 0.03% (8th percentile) and the CVE is NOT in CISA KEV - status is 'publicly available exploit code exists' but not actively exploited. The low EPSS is consistent with the real-world exploitation path: this is not a direct remote hit against the esm.sh service itself, but a supply-chain-style injection requiring an attacker to get malicious CSS served (e.g. via a published package) AND a victim application to import that CSS module with ?module (UI:R). The scope change (S:C) and I:H/A:H are justified because injected code executes in the victim's context - ordinary XSS in browsers but full RCE in Electron apps, which is the genuinely dangerous case. Net: a high-impact, low-probability issue - a real priority for anyone running Electron apps that import untrusted esm.sh CSS modules, but unlikely to see mass automated exploitation, matching the low EPSS. The patch is confirmed available (commit 87d2f64) and the fix is simple (JSON-encode all CSS, not just backtick-containing CSS), so remediation is straightforward. |
| Exploit ScenarioDerived | An attacker publishes (or compromises) a package whose CSS file contains a template-literal expression such as ${...}; when a victim app imports that CSS via esm.sh's ?module endpoint, esm.sh embeds the raw CSS into a JavaScript template literal and the ${...} payload executes in the victim's runtime. In a browser this yields XSS, and in an Electron application it yields remote code execution with the app's privileges. A public proof-of-concept is included in the GHSA advisory (GHSA-hcpf-qv9m-vfgp). |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv2 – Oct 18, 2026
Template literal injection in esm.sh before version 136 allows unauthenticated remote attackers to execute arbitrary JavaScript when a victim application imports a CSS file converted through the ?module feature. Since backtick-free CSS is embedded directly into a JavaScript template literal without escaping ${...} expressions, crafted CSS can achieve XSS in browsers and RCE in Electron applications; publicly available exploit code exists, but EPSS is low at 0.03% and active exploitation is not confirmed in CISA KEV. The issue requires user interaction because the payload executes only when the generated module is imported by a victim application.
Earlier versions of this analysis (1)
esm.sh is a nobuild content delivery network(CDN) for modern web development. Rated medium severity (CVSS 6.1), this vulnerability is remotely exploitable, no authentication required, low attack complexity. Public exploit code available.
RemediationAI
Upgrade esm.sh to version 136 or later; the vendor advisory GHSA-hcpf-qv9m-vfgp and commit 87d2f6497574bf4448641a5527a3ac2beba5fd6c document the fix, which minifies and JSON-encodes CSS before passing it to stylesheet.replaceSync(...), removing template-literal evaluation. If immediate upgrade is not possible, disable or block .css?module conversion at the CDN or reverse proxy, recognizing that clients relying on CSS-to-JavaScript module conversion will break, and avoid importing untrusted packages whose CSS is served through ?module. In Electron environments, also keep Node integration disabled and context isolation enabled where feasible, since these controls reduce the impact of injected JavaScript but do not fix the vulnerable esm.sh conversion.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in go
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
esm.sh is a no-build CDN for modern web development that can transform package assets into JavaScript modules. In affected versions, a .css file requested with ?module is converted into JavaScript using CSSStyleSheet and stylesheet.replaceSync(...); the conversion logic only JSON-escaped CSS when a backtick was present, while CSS without a backtick was inserted raw into a template literal. This is CWE-94 code injection because JavaScript template literals evaluate ${...} expressions, so attacker-controlled CSS can break out of the intended string context and execute code. The CVSS vector CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H reflects network reachability, no privileges, required victim import, scope change, and high confidentiality, integrity, and availability impact; browser runtimes yield XSS, while Electron runtimes can yield RCE. The affected CPE is cpe:2.3:a:esm:esm.sh:*:*:*:*:*:*:*:*, limited to versions prior to 136.
Know when Esm Sh 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
Sources disagree (Medium–Critical)AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
Attacker needs no auth to publish malicious CSS (PR:N) but a victim must import the module (UI:R); injected code escapes the CDN to run in the victim context (S:C) with XSS/RCE impact (C/I/A:H).
AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
vuln.today treats the vendor’s rating as authoritative. A higher third-party CVSS (e.g. CISA-ADP) is shown for transparency but does not drive the headline severity.
CVSS VectorNVD
Lifecycle Timeline
6DescriptionNVD
esm.sh is a nobuild content delivery network(CDN) for modern web development. Prior to version 136, The esm.sh CDN service contains a Template Literal Injection vulnerability (CWE-94) in its CSS-to-JavaScript module conversion feature. When a CSS file is requested with the ?module query parameter, esm.sh converts it to a JavaScript module by embedding the CSS content directly into a template literal without proper sanitization. An attacker can inject malicious JavaScript code using ${...} expressions within CSS files, which will execute when the module is imported by victim applications. This enables Cross-Site Scripting (XSS) in browsers and Remote Code Execution (RCE) in Electron applications. This issue has been patched in version 136.
Executive ViewAI
esm.sh versions before 136 can allow crafted CSS imported through the ?module feature to execute arbitrary JavaScript in victim applications, including browser apps and Electron desktop clients. Publicly available exploit code exists, and the vulnerability is rated critical, so any product relying on affected esm.sh imports should be treated as exposed until upgraded. Leadership should care because exploitation could compromise user sessions, application data, and endpoint integrity in affected web and desktop products.
Apply vendor patch.
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Affected Products (CPE)NVD
Path traversal during NPM tarball extraction in esm.sh CDN versions prior to 136 allows unauthenticated remote attackers
Path traversal in esm.sh CDN prior to version 0.0.0-20260116051925-c62ab83c589e allows unauthenticated remote attackers
esm.sh is a no-build content delivery network (CDN) for web development. In version 136, esm.sh is vulnerable to a full-
esm.sh versions up to 137 contain an SSRF vulnerability in the `/http(s)` fetch route that allows remote attackers to by
NVD
CVE.org
EPSS
GitHub
Exploit-DB