# CVE-2025-59342: esm.sh writes arbitrary files via path traversal in `X-Zone-Id` header

- Severity: Medium 5.5 (CVSS:4.0, scored by GitHub_M) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 3.28%, higher than 88% of CVEs (2026-12-02)
- Published: 2025-09-17T17:59:34.163Z
- Modified: 2026-09-10T03:50:28.407Z
- Also known as: GHSA-g2h5-cvvr-7gmw, GO-2025-3967
- Weaknesses: CWE-24
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- esm-dev esm.sh: <= 136
- github.com/esm-dev/esm.sh (Go): before 136.1; all versions

## Every score

- GitHub_M: CVSS:4.0 5.5 Medium `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`
- GitHub: CVSS:4.0 Medium `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`

## References

- <https://github.com/esm-dev/esm.sh/security/advisories/GHSA-g2h5-cvvr-7gmw> (advisory, web)
- <https://github.com/esm-dev/esm.sh/commit/833a29f42aeb0acbd7089a71be11dd0a292d3151> (fix, web)
- <https://github.com/esm-dev/esm.sh/blob/main/server/router.go#L116> (web)
- <https://github.com/esm-dev/esm.sh/blob/main/server/router.go#L411> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2025-59342> (advisory)
- <https://github.com/esm-dev/esm.sh> (package)
- <https://pkg.go.dev/vuln/GO-2025-3967> (web)

## Sources

- CVE List: [CVE-2025-59342](https://www.cve.org/CVERecord?id=CVE-2025-59342), CVE Terms of Use, modified 2026-01-14
- GitHub Advisory Database: [GHSA-g2h5-cvvr-7gmw](https://github.com/advisories/GHSA-g2h5-cvvr-7gmw), CC-BY-4.0, modified 2026-09-10
- Go Vulnerability Database: [GO-2025-3967](https://pkg.go.dev/vuln/GO-2025-3967), CC-BY-4.0, modified 2026-03-03
- NVD: [CVE-2025-59342](https://nvd.nist.gov/vuln/detail/CVE-2025-59342), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2025-59342 · Whole record: https://cve.day/CVE-2025-59342.json · Rebuilt by cve.day 2026-11-25T22:59:04.794Z
