All vulnerabilities

Go

CVE-2026-102657

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

Severity
High 7.5
Published
9 Nov 2026
Last changed
9 Nov 2026
Added to UpHeron
23 Nov 2026
Fixed in
0.2.0
Exploit chance
4% in the next 30 daysHigher than 90% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
Path traversal (CWE-22)
Attack
Over the network · No login needed · No user action needed
Attacker can
Read data
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Also known as
GHSA-g3c2-rjq2-c763
Sources
OSV.dev and GitHub

Description

The documented web.NewHandler static file server can read files outside Config.AppDir when the request path contains URL-encoded dot-segments such as %2e%2e. Go's ServeMux redirects plain /../ paths, but it passes encoded dot-segments to the handler after decoding r.URL.Path. The handler then calls filepath.Join(s.config.AppDir, r.URL.Path) without checking that the result remains under AppDir, allowing unauthenticated arbitrary file reads with the server process privileges.

web/README.md:34-40 documents a network-facing setup:

In web/handler.go:62-75, the handler takes r.URL.Path and joins it directly with s.config.AppDir:

Later the same resolved filename is opened and copied to the response in web/handler.go:150-166 for non-HTML/static files. There is no filepath.IsLocal, cleaned-relative-path, absolute-root prefix, or symlink-aware containment check before opening the file.

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Affected software

SoftwareAffected versions
github.com/esm-dev/esm.sh/webGo · osv:Go:github.com/esm-dev/esm.sh/web
  • Every version before 0.2.0

About github.com/esm-dev/esm.sh/web

This is the only vulnerability in github.com/esm-dev/esm.sh/web in our list.

References