Skip to main content

esm.sh CVE-2025-65026

CRITICAL
Code Injection (CWE-94)
2025-11-19 security-advisories@github.com
Critical
Disputed · 9.6 NVD
View

Attack ChainAIDerived

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

  1. Access
    Publish package with crafted CSS payload
  2. Delivery
    Victim app imports CSS via ?module
  3. Exploit
    esm.sh embeds raw CSS in template literal
  4. Execution
    ${...} expression evaluates as JavaScript
  5. Impact
    XSS 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).

Act Now Prioritize within 24-48h. Why: CRITICAL severity + public POC available.
Patch available 0.0% exploitation probability (EPSS)

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

Alert me

AnalysisAIv2 – 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)
v1 Mar 28, 2026 - 19:23 CVSS 6.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

go github.com/esm-dev/esm.sh fix: 0.0.0-20251118065157-87d2f6497574

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)
NVD PRIMARY 9.6 CRITICAL
AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
vuln.today AI 9.6 CRITICAL

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

3.1 AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
SUSE 6.1 MEDIUM
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

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

6
Analysis Updated
Oct 18, 2026 - 20:34 vuln.today
v2 - CVSS changed
Severity Changed
Oct 18, 2026 - 20:22 NVD
MEDIUM CRITICAL
CVSS changed
Oct 18, 2026 - 20:22 NVD
6.1 (MEDIUM) 9.6 (CRITICAL)
Patch released
Mar 28, 2026 - 19:23 nvd
Patch available
PoC Detected
Jan 15, 2026 - 17:53 vuln.today
Public exploit code
CVE Published
Nov 19, 2025 - 18:15 nvd
MEDIUM 6.1

DescriptionNVD

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

Why It Matters

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.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.0%
Top 92% exploitable
Prevalence
Medium
popular ESM/Deno-ecosystem CDN, common but not universally deployed
Exploit
POC
Public exploit code exists
Data Quality
5 sources
Confidence: Medium

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 CRITICAL
CISA KEV No
Public POC Yes
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity + public POC available
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· derived
Poc
System Exposure· derived
Open
Automatable· derived
No
Human Impact
High

Priority Score

68
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +48
PoC: +20
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.

Code Injection CRITICAL

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

cpe:2.3:a:esm:esm.sh:*:*:*:*:*:*:*:*

Vendor StatusVendor

SUSE

Severity: Medium

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