External risk intelligence

esm.sh CDN Path Traversal Vulnerability

CVE advisorySeverity: CRITICAL (CVSS 9.8)

CVE-2025-65025

esm.sh is a public-facing Content Delivery Network (CDN) service. As a CDN, its primary function is to serve content over the internet, making its core infrastructure and package handling services public-facing by design.

Path Traversal

Esm Sh

before 136

Halo Surface Signal: 5 out of 5 — more likely to be public-facing.

External exposure likelihood

Horizon Alert

Summary of the vulnerability and why it matters

The esm.sh CDN service, used for modern web development, has a vulnerability that allows an attacker to write files to arbitrary locations on the server by crafting a malicious package. This could lead to unauthorized data access or system compromise. The issue has been addressed in version 136 of the service.

  • Path traversal flaw in CDN package handling.
  • Critical risk if service is exposed externally.
  • Confirm relevance and confirm affected systems.

Attack Path

How an attacker could exploit the issue

An attacker could compromise the esm.sh CDN by uploading a specially crafted NPM package. The CDN's extraction process, when handling this malicious package, can be tricked into writing files to unintended locations on the server, potentially leading to further system compromise.

  • Unauthenticated network access required.
  • Malicious NPM package extraction.
  • Arbitrary file write to server.

Live Threat

Current exploitation, exposure, and threat context

A path traversal vulnerability in esm.sh could allow an attacker to write files to arbitrary locations on the server when it extracts malicious NPM packages. This could affect the integrity and availability of the esm.sh service.

  • Server files and directories at risk.
  • Malicious NPM package extraction.
  • Service availability and integrity could be impacted.

Operational Fix

Recommended remediation, mitigation, and detection steps

Identifying the appropriate teams to address this vulnerability requires understanding the deployment of esm.sh. Typically, a CDN service like this would fall under the purview of a platform engineering or infrastructure team responsible for its operation and availability. The first critical step is to determine the exact scope of the vulnerable component within your environment, assess its exposure to external attackers, and then pinpoint the accountable owner before planning a remediation strategy based on the identified risk.

  • Platform or infrastructure teams own resolution.
  • Verify public exposure and critical business impact.
  • Coordinate vendor update or temporary mitigation.

Supplementary metadata

Validate whether this threat affects your internet-facing exposure.

Halo Threat Intelligence helps prioritize remediation with Halo Surface Signal and H/A/L/O context. Start exposure validation with a free external attack surface trial.

Frequently asked questions

What is esm.sh?

esm.sh is a CDN designed for modern web development that provides an automated way to transform and serve NPM packages as ES modules. It allows developers to import modules directly in their browsers without a local build step. The service handles the complex task of fetching, reformatting, and delivering these packages, effectively acting as a bridge between the NPM registry and client-side code.

What is the vulnerability in CVE-2025-65025?

This CVE involves a Path Traversal vulnerability, classified as CWE-22. It occurs when the software fails to properly sanitize file paths within an NPM package. By using specific character sequences like dot-dot-slash, an attacker can trick the system during the extraction process into writing files outside of the intended directory, potentially placing malicious code into sensitive areas of the server filesystem.

How does an attacker trigger this path traversal?

An attacker triggers the flaw by hosting or submitting a specially crafted NPM package designed with malicious file paths. The vulnerability is tied specifically to the extraction logic used when the CDN processes these packages. Simply visiting the CDN or requesting legitimate packages does not trigger the bug; the vulnerability requires the system to ingest and unpack a package containing these manipulated directory traversal paths.

Is my instance of esm.sh at risk?

If you are running a version of esm.sh prior to 136, your service is potentially affected. According to Halo Surface Signal, because esm.sh functions as a content delivery network, its core infrastructure is typically internet-facing by design to facilitate public file delivery. This public availability makes the service more accessible to external actors who might attempt to upload or trigger the processing of malicious packages.

How do I fix the CVE-2025-65025 vulnerability?

The primary resolution is to upgrade your esm.sh deployment to version 136 or later, which includes the necessary patches to safely handle package extraction. Before applying the update, verify your current version and identify the platform or infrastructure team responsible for maintaining your CDN environment to coordinate the rollout and ensure service continuity.

References