{"id":"CVE-2025-59342","state":"PUBLISHED","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.","publishedAt":"2025-09-17T17:59:34.163Z","updatedAt":"2026-01-14T15:52:09.174Z","severity":{"score":5.5,"label":"Medium","version":"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","source":"GitHub_M"},"assigner":"GitHub_M","products":["esm-dev esm.sh"],"affected":[{"vendor":"esm-dev","product":"esm.sh","versions":[{"version":"<= 136","status":"affected"}]}],"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"],"weaknesses":["CWE-24"],"ingestedAt":"2026-10-29T20:09:39.787Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/59xxx/CVE-2025-59342.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-59342","state":"PUBLISHED","datePublished":"2025-09-17T17:59:34.163Z","dateUpdated":"2026-01-14T15:52:09.174Z","assignerShortName":"GitHub_M","assignerOrgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateReserved":"2025-09-12T12:36:24.636Z"},"containers":{"cna":{"title":"esm.sh writes arbitrary files via path traversal in `X-Zone-Id` header","descriptions":[{"lang":"en","value":"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."}],"affected":[{"vendor":"esm-dev","product":"esm.sh","versions":[{"version":"<= 136","status":"affected"}]}],"references":[{"url":"https://github.com/esm-dev/esm.sh/security/advisories/GHSA-g2h5-cvvr-7gmw","name":"https://github.com/esm-dev/esm.sh/security/advisories/GHSA-g2h5-cvvr-7gmw","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/esm-dev/esm.sh/commit/833a29f42aeb0acbd7089a71be11dd0a292d3151","name":"https://github.com/esm-dev/esm.sh/commit/833a29f42aeb0acbd7089a71be11dd0a292d3151","tags":["x_refsource_MISC"]},{"url":"https://github.com/esm-dev/esm.sh/blob/main/server/router.go#L116","name":"https://github.com/esm-dev/esm.sh/blob/main/server/router.go#L116","tags":["x_refsource_MISC"]},{"url":"https://github.com/esm-dev/esm.sh/blob/main/server/router.go#L411","name":"https://github.com/esm-dev/esm.sh/blob/main/server/router.go#L411","tags":["x_refsource_MISC"]}],"metrics":[{"cvssV4_0":{"attackVector":"NETWORK","attackComplexity":"LOW","attackRequirements":"NONE","privilegesRequired":"NONE","userInteraction":"NONE","vulnConfidentialityImpact":"NONE","vulnIntegrityImpact":"LOW","vulnAvailabilityImpact":"NONE","subConfidentialityImpact":"NONE","subIntegrityImpact":"NONE","subAvailabilityImpact":"NONE","baseScore":5.5,"baseSeverity":"MEDIUM","vectorString":"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","version":"4.0"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-24","lang":"en","description":"CWE-24: Path Traversal: '../filedir'","type":"CWE"}]}],"providerMetadata":{"shortName":"GitHub_M","orgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateUpdated":"2026-01-14T15:52:09.174Z"},"source":{"advisory":"GHSA-g2h5-cvvr-7gmw","discovery":"UNKNOWN"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2025-09-17T18:19:55.260782Z","id":"CVE-2025-59342","options":[{"Exploitation":"poc"},{"Automatable":"yes"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2025-09-17T18:20:28.195Z"}}]}}}