{"id":"EUVD-2025-29764","revision":null,"records":[{"revision":"401a86339de34350a0415ea5d4a5aa51","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2025-59342","aliases":[],"title":"esm.sh writes arbitrary files via path traversal in `X-Zone-Id` header","description":"esm.sh is a nobuild content delivery network(CDN) for modern web development. In 136 and earlier, a path-traversal flaw in the handling of the X-Zone-Id HTTP header allows an attacker to cause the application to write files outside the intended storage location. The header value is used to build a filesystem path but is not properly canonicalized or restricted to the application’s storage base directory. As a result, supplying ../ sequences in X-Zone-Id causes files to be written to arbitrary directories. Version 136.1 contains a patch.","state":0,"publishedAt":"2025-09-17T17:59:34.163+00:00","modifiedAt":"2026-01-14T15:52:09.174+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\": \"<= 136\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:P","score":5.5,"severity":"MEDIUM"}],"references":["https://github.com/esm-dev/esm.sh/security/advisories/GHSA-g2h5-cvvr-7gmw","https://github.com/esm-dev/esm.sh/commit/833a29f42aeb0acbd7089a71be11dd0a292d3151","https://github.com/esm-dev/esm.sh/blob/main/server/router.go#L116","https://github.com/esm-dev/esm.sh/blob/main/server/router.go#L411"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2025-59342","license":"CVE Program Terms of Use","key":"cve-program:CVE-2025-59342","identifiers":["CVE-2025-59342"]},"retained":false,"historicalAffected":[]},{"revision":"45dca3b37da247a298110bbe2dfa834e","observedAt":"2026-11-15T04:38:16.392+00:00","statement":{"source":"euvd","id":"EUVD-2025-29764","aliases":["CVE-2025-59342","GHSA-g2h5-cvvr-7gmw"],"title":"esm.sh is a nobuild content delivery network(CDN) for modern web development. In 136 and earlier, a path-traversal flaw in the handling of the X-Zone-Id HTTP header allows an attacker to cause the application to write files outside the inte…","description":"esm.sh is a nobuild content delivery network(CDN) for modern web development. In 136 and earlier, a path-traversal flaw in the handling of the X-Zone-Id HTTP header allows an attacker to cause the application to write files outside the intended storage location. The header value is used to build a filesystem path but is not properly canonicalized or restricted to the application’s storage base directory. As a result, supplying ../ sequences in X-Zone-Id causes files to be written to arbitrary directories. Version 136.1 contains a patch.","state":0,"publishedAt":null,"modifiedAt":null,"affected":[],"metrics":[{"system":"EUVD CVSS 4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:P","score":5.5,"severity":null}],"references":["https://github.com/esm-dev/esm.sh/security/advisories/GHSA-g2h5-cvvr-7gmw","https://github.com/esm-dev/esm.sh/commit/833a29f42aeb0acbd7089a71be11dd0a292d3151","https://github.com/esm-dev/esm.sh/blob/main/server/router.go#L116","https://github.com/esm-dev/esm.sh/blob/main/server/router.go#L411"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2025-29764","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"Sep 17, 2025, 5:59:34 PM","dateUpdated":"Jan 14, 2026, 3:52:09 PM"},"relatedAdvisories":[{"id":"openSUSE-SU-2025:15576-1","title":"govulncheck-vulndb-0.0.20250924T192141-1.1 on GA media","vulnerabilityIds":["CVE-2025-10630","CVE-2025-59341","CVE-2025-59342","CVE-2025-59345","CVE-2025-59346","CVE-2025-59347","CVE-2025-59348","CVE-2025-59349","CVE-2025-59350","CVE-2025-59351","CVE-2025-59352","CVE-2025-59353","CVE-2025-59354","CVE-2025-59410","CVE-2025-9079","CVE-2025-9081"]}],"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-2025-29764","identifiers":["EUVD-2025-29764","CVE-2025-59342","GHSA-g2h5-cvvr-7gmw"]},"retained":false,"historicalAffected":[]},{"revision":"2610a9848cb04c199fd0e42ef4123b72","observedAt":"2026-10-25T03:17:18.142+00:00","statement":{"source":"nvd","id":"CVE-2025-59342","aliases":[],"title":"esm.sh is a nobuild content delivery network(CDN) for modern web development. In 136 and earlier, a path-traversal flaw in the handling of the X-Zone-Id HTTP header allows an attacker to cause the application to write files outside the inte…","description":"esm.sh is a nobuild content delivery network(CDN) for modern web development. In 136 and earlier, a path-traversal flaw in the handling of the X-Zone-Id HTTP header allows an attacker to cause the application to write files outside the intended storage location. The header value is used to build a filesystem path but is not properly canonicalized or restricted to the application’s storage base directory. As a result, supplying ../ sequences in X-Zone-Id causes files to be written to arbitrary directories. Version 136.1 contains a patch.","state":0,"publishedAt":"2025-09-17T18:15:53.55+00:00","modifiedAt":"2026-06-17T09:45:56.447+00:00","affected":[],"metrics":[{"system":"CVSS 4.0 · security-advisories@github.com · Secondary","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:P/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","score":5.5,"severity":"MEDIUM"}],"references":["https://github.com/esm-dev/esm.sh/blob/main/server/router.go#L116","https://github.com/esm-dev/esm.sh/blob/main/server/router.go#L411","https://github.com/esm-dev/esm.sh/commit/833a29f42aeb0acbd7089a71be11dd0a292d3151","https://github.com/esm-dev/esm.sh/security/advisories/GHSA-g2h5-cvvr-7gmw"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2025-59342","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Deferred","weaknesses":["CWE-24"],"productCriteria":[],"sourceDates":{"published":"2025-09-17T18:15:53.550","lastModified":"2026-06-17T09:45:56.447"},"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-2025-59342","identifiers":["CVE-2025-59342"]},"retained":false,"historicalAffected":[]},{"revision":"2254c12c353c487eaf5f5f2b7b235553","observedAt":"2026-10-24T13:19:41.952+00:00","statement":{"source":"osv","id":"GHSA-g2h5-cvvr-7gmw","aliases":["CVE-2025-59342","GO-2025-3967"],"title":"esm.sh has arbitrary file write via path traversal in `X-Zone-Id` header","description":"## Summary\n\nA path-traversal flaw in the handling of the `X-Zone-Id` HTTP header allows an attacker to cause the application to write files outside the intended storage location. The header value is used to build a filesystem path but is not properly canonicalized or restricted to the application’s storage base directory. As a result, supplying `../` sequences in `X-Zone-Id` causes files to be written to arbitrary directories (example observed: `~/.esmd/modules/transform/<id>/` instead of `~/.esmd/storage/modules/transform`).\n\n**Severity:** Medium\n\n**Component / Endpoint:** \n\n`POST /transform` — handling of `X-Zone-Id` header\n\nThe vulnerable code is in https://github.com/esm-dev/esm.sh/blob/main/server/router.go#L116 and https://github.com/esm-dev/esm.sh/blob/main/server/router.go#L411 \n\n**Impact:** Arbitrary file creation / overwrite outside intended storage directory (file write to attacker-controlled path). Possible remote code execution, persistence, tampering with application files, or facilitating further path-traversal attacks.\n\n---\n\n## Proof of Concept (POC)\n\nRequest (attacker-supplied `X-Zone-Id` contains path traversal):\n\n```\nPOST /transform HTTP/1.1\nHost: localhost:8888\nUser-Agent: Den/8.7.1\nAccept: */*\nConnection: keep-alive\nReferer: http://localhost:9999/\nContent-Type: application/json\nX-Zone-Id: ../../modules/transform/c245626ef6ca0fd9ee37759c5fac606c6ec99daa/\nContent-Length: 325\n\n{\n  \"filename\": \"example2.js\",\n  \"lang\": \"js\",\n  \"code\": \"console.log('hello');\",\n  \"importMap\": {\n    \"imports\": {\n      \"react\": \"https://esm.sh/react\",\n      \"react-dom\": \"https://esm.sh/react-dom\"\n    }\n  },\n  \"jsxImportSource\": \"react\",\n  \"target\": \"es2022\",\n  \"sourceMap\": \"external\",\n  \"minify\": true\n}\n```\n<img width=\"2496\" height=\"1214\" alt=\"Screenshot 2025-09-16 at 21 40 57\" src=\"https://github.com/user-attachments/assets/f878c3f0-5d7d-410c-97ac-20116f5496db\" />\n\n\nObserved result: file written to `~/.esmd/modules/transform/c245626ef6ca0fd9ee37759c5fac606c6ec99daa/example2.js` instead of the intended `~/.esmd/storage/modules/transform/`.\n\nThis can be trigger with another path traversal request below\n\n```\nGET /+c245626ef6ca0fd9ee37759c5fac606c6ec99daa./../../../esm.db?.css HTTP/1.1\nHost: localhost:8888\nUser-Agent: localhost\nAccept: */*\nConnection: keep-alive\nX-Zone-Id: ../\nReferer: http://localhost:9999/\n\n```\n<img width=\"2516\" height=\"710\" alt=\"Screenshot 2025-09-16 at 21 37 07\" src=\"https://github.com/user-attachments/assets/1fcfbed3-c1d2-4093-82d8-4afda225c685\" />\n\n---\n\n## Remediation\n\nSimply remove any .. in the `X-Zone-Id` header before actually process the file.\n\n## Credits\n\n- [Ai Ho (Jessie)](https://github.com/j3ssie)\n- [CL Yang](https://github.com/A11riseforme)","state":0,"publishedAt":"2025-09-17T19:03:05+00:00","modifiedAt":"2026-09-10T03:50:28.4074136+00:00","affected":[{"ecosystem":"Go","name":"github.com/esm-dev/esm.sh","ranges":[{"type":"ECOSYSTEM","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"136.1"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V4","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:P","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"MODERATE"}],"references":["https://github.com/esm-dev/esm.sh/security/advisories/GHSA-g2h5-cvvr-7gmw","https://nvd.nist.gov/vuln/detail/CVE-2025-59342","https://github.com/esm-dev/esm.sh/commit/833a29f42aeb0acbd7089a71be11dd0a292d3151","https://github.com/esm-dev/esm.sh","https://github.com/esm-dev/esm.sh/blob/main/server/router.go#L116","https://github.com/esm-dev/esm.sh/blob/main/server/router.go#L411","https://pkg.go.dev/vuln/GO-2025-3967"],"sourceUrl":"https://github.com/advisories/GHSA-g2h5-cvvr-7gmw","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-g2h5-cvvr-7gmw","identifiers":["GHSA-g2h5-cvvr-7gmw","CVE-2025-59342","GO-2025-3967"]},"retained":false,"historicalAffected":[]},{"revision":"df1d046e93dd469caaf09d15cf781a0d","observedAt":"2026-10-24T13:19:41.952+00:00","statement":{"source":"osv","id":"GO-2025-3967","aliases":["CVE-2025-59342","GHSA-g2h5-cvvr-7gmw"],"title":"esm.sh has arbitrary file write via path traversal in `X-Zone-Id` header in github.com/esm-dev/esm.sh","description":"esm.sh has arbitrary file write via path traversal in `X-Zone-Id` header in github.com/esm-dev/esm.sh","state":0,"publishedAt":"2025-09-24T19:21:37+00:00","modifiedAt":"2026-03-03T04:56:55.361146+00:00","affected":[{"ecosystem":"Go","name":"github.com/esm-dev/esm.sh","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[],"references":["https://github.com/esm-dev/esm.sh/security/advisories/GHSA-g2h5-cvvr-7gmw","https://nvd.nist.gov/vuln/detail/CVE-2025-59342","https://github.com/esm-dev/esm.sh/commit/833a29f42aeb0acbd7089a71be11dd0a292d3151","https://github.com/esm-dev/esm.sh/blob/main/server/router.go#L116","https://github.com/esm-dev/esm.sh/blob/main/server/router.go#L411"],"sourceUrl":"https://osv.dev/vulnerability/GO-2025-3967","license":"OSV · upstream source license applies","key":"osv:GO-2025-3967","identifiers":["GO-2025-3967","CVE-2025-59342","GHSA-g2h5-cvvr-7gmw"]},"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-16T11:44:54.7554632+00:00","complete":true,"records":1781,"lastAttemptAt":"2026-11-16T11:44:54.7554632+00:00","lastSuccessAt":"2026-11-16T11:44:55.1148132+00:00","error":null,"lastVerifiedAt":"2026-11-16T11:44:55.1148147+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-b031c4c30f2ebe9268e5c5d33f4ea89da65ca3c9f9859f880ef288344bde788d","complete":true,"records":425916,"lastAttemptAt":"2026-11-16T11:44:52.8756103+00:00","lastSuccessAt":"2026-11-16T11:44:52.8348352+00:00","error":null,"lastVerifiedAt":"2026-11-16T11:44:52.8756103+00:00","snapshotPublishedAt":"2026-11-16T11:24:27+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-65ed5f72e9cf4d7d944fddd792d50665","complete":false,"records":13821,"lastAttemptAt":"2026-11-16T11:45:45.2492397+00:00","lastSuccessAt":"2026-11-16T10:31:57.938+00:00","error":"10 identifier lookups failed; latest failures include AccessDenied (HTTP 403). Other identifiers were checked independently.","lastVerifiedAt":"2026-11-16T10:31:57.938+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13864,"expectedIdentifiers":13874,"failedIdentifiers":10},{"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-16T11:44:54.7554632+00:00","complete":true,"records":1125,"lastAttemptAt":"2026-11-16T11:44:54.7554632+00:00","lastSuccessAt":"2026-11-16T11:44:55.1387791+00:00","error":null,"lastVerifiedAt":"2026-11-16T11:44:55.1387803+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-f5f7edac8e2f41ed81f50e079874026a","complete":false,"records":13833,"lastAttemptAt":"2026-11-16T11:45:44.5423454+00:00","lastSuccessAt":"2026-11-16T11:45:44.539+00:00","error":"400 identifier lookups failed; latest failures include HttpError (HTTP 503). Other identifiers were checked independently.","lastVerifiedAt":"2026-11-16T11:45:44.539+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-16T11:44:54.4664396+00:00","lastSuccessAt":"2026-11-14T13:57:23.1208135+00:00","error":null,"lastVerifiedAt":"2026-11-16T11:44:54.4664396+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-16T11:44:54.2102075+00:00","lastSuccessAt":"2026-11-13T19:57:08.2864435+00:00","error":null,"lastVerifiedAt":"2026-11-16T11:44:54.2102075+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-16T11:44:54.5871554+00:00","lastSuccessAt":"2026-11-15T11:05:17.1034234+00:00","error":null,"lastVerifiedAt":"2026-11-16T11:44:54.5871554+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-16T11:44:54.3524798+00:00","lastSuccessAt":"2026-11-16T07:32:30.5701252+00:00","error":null,"lastVerifiedAt":"2026-11-16T11:44:54.3524798+00:00","snapshotPublishedAt":"2026-11-16T06:48:00+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}