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

- Priority: **Routine**
- Reason: Not severe (CVSS 5.5, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2025-09-17 · Modified: 2026-01-14
- Aliases: GHSA-g2h5-cvvr-7gmw, GO-2025-3967
- Record: https://cvemate.com/vulnerability/CVE-2025-59342 · JSON: https://cvemate.com/vulnerability/CVE-2025-59342/json

## Description

```text
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.
```

## Signals

- CVSS: 5.5 medium (v4.0, CVE.org) 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
- EPSS: 3.284%, percentile 88.849%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 1 (exploit-database)

## Affected

- esm-dev esm.sh: ≤ 136
- github.com/esm-dev esm.sh (Go): \< 136.1 \| All versions (No fix recorded)

## 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>
- <https://nvd.nist.gov/vuln/detail/CVE-2025-59342>
- <https://github.com/esm-dev/esm.sh>
- <https://pkg.go.dev/vuln/GO-2025-3967>

---

Data as of 2026-12-05T14:01:19.747Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
