VYPR
High severityNVD Advisory· Published Nov 19, 2025· Updated Nov 20, 2025

esm.sh CDN service has arbitrary file write via tarslip

CVE-2025-65025

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.

PackageAffected versionsPatched versions
github.com/esm-dev/esm.shGo
< 0.0.0-20251117232647-9d77b88c32070.0.0-20251117232647-9d77b88c3207

Affected products

1

Patches

1
9d77b88c3207

Clean tar save file path (#1236)

https://github.com/esm-dev/esm.shJe XiaNov 17, 2025via ghsa
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

News mentions

0

No linked articles in our index yet.