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
- Attacker crafts an HTTP GET request containing URL-encoded traversal segments (e.g.,
/%2e%2e/%2e%2e/secret.txt). - The network-facing
http.ServeMuxdecodes the request path. - Because the segments are URL-encoded,
ServeMuxdoes not block or redirect the request. - The request is passed to
web.NewHandler. web.NewHandlerjoins theConfig.AppDirpath with the decodedr.URL.Path.- The application performs
os.Lstatandos.Openon the resulting path, which resolves to a location outside the application directory. - 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
- Upgrade
esm.sh/webto version 0.2.0 or later immediately. - For environments where upgrading is delayed, apply input validation at the web server or proxy level to block request paths containing
%2eor..segments. - 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
Threat Hunt
Inspect web server access logs for anomalous encoded path sequences
Data: cs-uri-query
Mitigations
Implement WAF rules to block %2e%2e in URI
CVE-2026-102657
Detection coverage 1
Detect CVE-2026-102657 Exploitation - Encoded Dot-Segment Path Traversal
highDetects attempts to exploit CVE-2026-102657 by searching for URL-encoded dot-segments in HTTP request URIs.
Detection queries are available on the platform. Get full rules →