Vulnerability · Published Nov 20, 2025 · Assigned by Google

CVE-2025-13437Arbitrary node_modules Directory Deletion in Google zx

Medium 5.6

In plain English

A medium-severity security flaw in zx from Google. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.1% (higher than 0% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 4.0)5.6Medium
Exploit odds (30 days)<0.1%top 99.5% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

Official description

When zx is invoked with --prefer-local=<path>, the CLI creates a symlink named ./node_modules pointing to <path>/node_modules. Due to a logic error in src/cli.ts (linkNodeModules / cleanup), the function returns the target path instead of the alias (symlink path). The later cleanup routine removes what it received, which deletes the target directory itself. Result: zx can delete an external <path>/node_modules outside the current working directory.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
npmzx8.8.5GHSA-w87r-vg9q-crqm

Affected products (as reported)

VendorProductVersions
Google zx 8.8.4

Weakness: CWE-706 · Vector: CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:H/VA:H/SC:N/SI:H/SA:H/E:U

References