esm.sh writes arbitrary files via path traversal in `X-Zone-Id` header
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Attack requirements
- None
- Impact type
- —
- Confidentiality · integrity · availability
- None · Low · None
- Fix status
- Fixed
Attack profile from CVSS 4.0 · CNA. Fix status from CNA and GitHub.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- Yes
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| esm-dev | esm.sh | up to 136 | — | No fix listed | CNA |
| — | github.com/esm-dev/esm.sh (Go) | before 136.1 | 136.1 | Patch available | GHSA-g2h5-cvvr-7gmw |
- esm.sh Vendoresm-dev Affected up to 136 Fixed in — No fix listed CNA
- github.com/esm-dev/esm.sh (Go) Vendor— Affected before 136.1 Fixed in 136.1 Patch available GHSA-g2h5-cvvr-7gmw
Remediation
- Fix · GHSA-g2h5-cvvr-7gmw github.com/esm-dev/esm.sh (Go) Fixed in 136.1 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2025-59342
- 2026-10-03 Alias added: GHSA-g2h5-cvvr-7gmw
References
Other 6
- 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://github.com/esm-dev/esm.sh
- https://pkg.go.dev/vuln/GO-2025-3967
More esm-dev vulnerabilities
- TI-2025-40211 esm.sh CDN service has arbitrary file write via tarslip CVSS 3.1CRITICAL 9.8
- TI-2026-32504 esm.sh: Legacy Route Path Traversal Can Lead to RCE CVSS 4.0HIGH 8.7
- TI-2025-32063 esm.sh is vulnerable to full-response SSRF CVSS 4.0HIGH 8.7
- TI-2025-40212 esm.sh CDN service has JS Template Literal Injection in CSS-to-JavaScript CVSS 3.1CRITICAL 9.6
- TI-2025-36902 Local File Inclusion in esm.sh CVSS 4.0HIGH 7.7
- TI-2026-32505 esm.sh: Path Traversal via package.json browser field allows reading arbitrary server files CVSS 3.1HIGH 7.5
Sources
- CVE-2025-59342 · CVE Program
- CVE-2025-59342 · NVD
- FIRST EPSS
- GHSA-g2h5-cvvr-7gmw · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences