Skip to content
Threat Feed
high advisory

esm.sh: web.NewHandler arbitrary file read via encoded dot-segment path traversal (CVE-2026-102657)

An unauthenticated path traversal vulnerability in esm.sh/web allows remote attackers to read arbitrary files by sending requests with URL-encoded dot-segments.

CVE search metadata

CVE search record: CVE-2026-102657. Severity: high. CVSS: 7.5. EPSS: 0.72%. KEV: no. Product: esm.sh/web (< 0.2.0). Brief: esm.sh: web.NewHandler arbitrary file read via encoded dot-segment path traversal (CVE-2026-102657). Brief link: https://feed.craftedsignal.io/briefs/2026-11-esm-sh-path-traversal/

Triage facts

Revision 1
Applicability
esm.sh/web (< 0.2.0)
Evidence
Unknown
Severity
High
Action
Elevated
Sources
1 public source
Freshness
Revision 1Nov 10, 04:16 UTC
Detection
1 rule
Vulnerabilities
1 CVE
Source quality
A1Likely

The web.NewHandler component in esm.sh/web (versions < 0.2.0) contains a path traversal vulnerability. When a request path contains URL-encoded dot-segments (e.g., %2e%2e), Go's ServeMux fails to redirect the request, and the handler proceeds to join the decoded path with AppDir without performing a containment check. This allows unauthenticated attackers to read files located outside the intended application directory, restricted only by the filesystem permissions of the server process.

Attack Chain

  1. Attacker crafts an HTTP GET request containing URL-encoded traversal segments (e.g., /%2e%2e/%2e%2e/secret.txt).
  2. The network-facing http.ServeMux decodes the request path.
  3. Because the segments are URL-encoded, ServeMux does not block or redirect the request.
  4. The request is passed to web.NewHandler.
  5. web.NewHandler joins the Config.AppDir path with the decoded r.URL.Path.
  6. The application performs os.Lstat and os.Open on the resulting path, which resolves to a location outside the application directory.
  7. The server reads the file content and copies it into the HTTP response body, disclosing sensitive data to the attacker.

Impact

Successful exploitation allows unauthenticated remote attackers to read arbitrary files on the filesystem accessible to the application process. This may include configuration files, environment variables, source code, or private keys, depending on the server configuration and file permissions.

Recommendation

  1. Upgrade esm.sh/web to version 0.2.0 or later immediately.
  2. For environments where upgrading is delayed, apply input validation at the web server or proxy level to block request paths containing %2e or .. segments.
  3. Ensure the web application runs with the principle of least privilege, restricting the filesystem access of the process to the absolute minimum required by AppDir.

Immediate actions

Patch esm.sh/web to version 0.2.0 or later

IT Operations 24h

Threat Hunt

Inspect web server access logs for anomalous encoded path sequences

T1190 high high confidence convert to detection

Data: cs-uri-query

Mitigations

Implement WAF rules to block %2e%2e in URI

immediate IT Operations

CVE-2026-102657

Detection coverage 1

Detect CVE-2026-102657 Exploitation - Encoded Dot-Segment Path Traversal

high

Detects attempts to exploit CVE-2026-102657 by searching for URL-encoded dot-segments in HTTP request URIs.

sigma tactics: initial_access techniques: T1190 sources: webserver

Detection queries are available on the platform. Get full rules →