esm.sh CDN service has arbitrary file write via tarslip
Description
esm.sh is a nobuild content delivery network(CDN) for modern web development. Prior to version 136, the esm.sh CDN service is vulnerable to path traversal during NPM package tarball extraction. An attacker can craft a malicious NPM package containing specially crafted file paths (e.g., package/../../tmp/evil.js). When esm.sh downloads and extracts this package, files may be written to arbitrary locations on the server, escaping the intended extraction directory. This issue has been patched in version 136.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
github.com/esm-dev/esm.shGo | < 0.0.0-20251117232647-9d77b88c3207 | 0.0.0-20251117232647-9d77b88c3207 |
Affected products
1Patches
19d77b88c3207Clean tar save file path (#1236)
1 file changed · +1 −1
server/npmrc.go+1 −1 modified@@ -546,7 +546,7 @@ func extractPackageTarball(installDir string, pkgName string, tarball io.Reader) } // strip tarball root dir _, name := utils.SplitByFirstByte(h.Name, '/') - filename := path.Join(pkgDir, name) + filename := path.Join(pkgDir, path.Clean(name)) if h.Typeflag != tar.TypeReg { continue }
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
4- github.com/advisories/GHSA-h3mw-4f23-gwpwghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2025-65025ghsaADVISORY
- github.com/esm-dev/esm.sh/commit/9d77b88c320733ff6689d938d85d246a3af9af16ghsax_refsource_MISCWEB
- github.com/esm-dev/esm.sh/security/advisories/GHSA-h3mw-4f23-gwpwghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.