CVE-2026-102657

esm.sh: web.NewHandler allows arbitrary file read via encoded dot-segment path traversal

Published Nov 6, 2026 CVSS 3.1 · 7.5 High EPSS 3.7% KEV · Not listed
Description
esm.sh is a no-build content delivery network (CDN) for web development. Prior to server version 137_7, the documented web.NewHandler static file server in web/handler.go joins the URL-decoded r.URL.Path with Config.AppDir without verifying that the result remains inside the configured application directory. URL-encoded dot segments such as %2e%2e bypass the plain traversal redirect performed by Go's ServeMux, allowing an unauthenticated remote attacker to make the server open and return files outside Config.AppDir that are readable by the server process. The confirmed impact is file disclosure only, and the issue is reachable with Dev disabled. This issue is fixed in server version 137_7.

Analysis

AI-generated

Technical impact

The vulnerability exists in the web.NewHandler static file server of esm.sh. The handler concatenates the request path with the configured application directory without ensuring that the resulting path remains under that directory. URL‑encoded dot segments such as %2e%2e bypass Go’s internal redirection checks, allowing an attacker to craft a request that resolves to arbitrary files on the server. The sole confirmed impact is the disclosure of files readable by the server process; there is no privilege escalation or code execution. This flaw is associated with CWE‑22.

Affected Systems

The issue affects all esm.sh server releases before version 137_7. Any instance of the CDN running an older server is vulnerable, regardless of the deployment environment, and the vulnerability can be exploited even when developer mode is disabled. The affected product is esm.sh delivered by esm-dev.

Risk and Exploitability

The CVSS score of 7.5 places the flaw in the high severity range, and with an EPSS score of 4%, the vulnerability is not listed in CISA's KEV catalog. An unauthenticated remote attacker can trigger the flaw by sending a specially crafted HTTP request to the static file server; because the redirect logic is bypassed, no prior authentication is needed. The risk is significant for publicly exposed instances, as attackers can read arbitrary configuration, source code, or other sensitive files that the web server can access.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Deploy esm.sh server version 137_7 or newer, which includes a guard against dot‑segment traversal.
  • If an upgrade cannot be applied immediately, restrict access to the CDN’s static file endpoints with firewall rules or network ACLs so that only trusted clients can reach them.
  • If feasible, temporarily disable the web.NewHandler static file server or reconfigure it to reject paths containing dot segments until the patch is in place.

Generated by OpenCVE AI on November 22, 2026 at 20:19 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-g3c2-rjq2-c763 esm.sh: web.NewHandler allows arbitrary file read via encoded dot-segment path traversal
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Esm-dev
Esm-dev esmsh
Vendors & Products Esm-dev
Esm-dev esmsh
Type Values Removed Values Added
Description esm.sh is a no-build content delivery network (CDN) for web development. Prior to server version 137_7, the documented web.NewHandler static file server in web/handler.go joins the URL-decoded r.URL.Path with Config.AppDir without verifying that the result remains inside the configured application directory. URL-encoded dot segments such as %2e%2e bypass the plain traversal redirect performed by Go's ServeMux, allowing an unauthenticated remote attacker to make the server open and return files outside Config.AppDir that are readable by the server process. The confirmed impact is file disclosure only, and the issue is reachable with Dev disabled. This issue is fixed in server version 137_7.
Title esm.sh: web.NewHandler allows arbitrary file read via encoded dot-segment path traversal
Weaknesses CWE-22
References
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N'}

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Nov 11, 2026, 3:30 AM
Reserved
Sep 29, 2026, 3:56 PM
Status
Deferred
Published
Nov 6, 2026, 9:17 PM
Modified
Nov 11, 2026, 5:19 AM