{"id":"CVE-2025-13437","aliases":["EUVD-2025-198297","GHSA-w87r-vg9q-crqm"],"status":"published","title":"Arbitrary node_modules Directory Deletion in Google zx","description":"When zx is invoked with --prefer-local=\u003cpath\u003e, the CLI creates a symlink named ./node_modules pointing to \u003cpath\u003e/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 \u003cpath\u003e/node_modules outside the current working directory.","severity":{"version":"4.0","score":5.6,"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","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-10","score":0.00091,"percentile":0.00456,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-706"],"published":"2025-11-20T16:25:16Z","modified":"2026-10-28T02:31:02Z","fixes":[{"ecosystem":"npm","package":"zx","fixed_in":["8.8.5"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"zx","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"8.8.5"}]}]},{"source":"osv","ecosystem":"npm","package":"zx","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"8.8.5"}]}]}],"products":[{"vendor":"google","product":"zx"}],"references":[{"url":"https://github.com/google/zx/issues/1348","tags":["report","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-13437","tags":["advisory"]},{"url":"https://github.com/google/zx/pull/1349","tags":["web"]},{"url":"https://github.com/google/zx/pull/1355","tags":["web"]},{"url":"https://github.com/google/zx/commit/9ef6d3c9962c4ba01e3fb8075855570c192b4681","tags":["web"]},{"url":"https://github.com/google/zx/commit/a4d1bc2467f305f1c91d62506e215f307dc1fbeb","tags":["web"]},{"url":"https://github.com/advisories/GHSA-w87r-vg9q-crqm"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/13xxx/CVE-2025-13437.json","tags":["advisory"]},{"url":"https://github.com/google/zx","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2025-13437","title":"Arbitrary node_modules Directory Deletion in Google zx","description":"When zx is invoked with --prefer-local=\u003cpath\u003e, the CLI creates a symlink named ./node_modules pointing to \u003cpath\u003e/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 \u003cpath\u003e/node_modules outside the current working directory.","status":"published","published":"2025-11-20T16:25:16.866Z","modified":"2025-11-20T16:49:32.47Z","cvss":[{"version":"4.0","score":5.6,"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","level":"medium","assessor":"cna"}],"cwes":["CWE-706"],"updated_at":"2026-11-02T14:32:43.437394Z"}],"euvd":[{"id":"EUVD-2025-198297","description":"When zx is invoked with --prefer-local=\u003cpath\u003e, the CLI creates a symlink named ./node_modules pointing to \u003cpath\u003e/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 \u003cpath\u003e/node_modules outside the current working directory.","status":"published","published":"2025-11-20T16:25:16Z","modified":"2025-11-20T16:49:32Z","cvss":[{"version":"4.0","score":5.6,"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","level":"medium"}],"updated_at":"2026-11-02T19:49:14.564249Z"}],"ghsa":[{"id":"GHSA-w87r-vg9q-crqm","title":"zx Uses Incorrectly-Resolved Name or Reference","description":"When zx is invoked with --prefer-local=\u003cpath\u003e, the CLI creates a symlink named ./node_modules pointing to \u003cpath\u003e/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 \u003cpath\u003e/node_modules outside the current working directory.","status":"published","published":"2025-11-20T18:31:01Z","modified":"2025-11-21T18:01:33Z","cvss":[{"version":"4.0","score":5.6,"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","level":"medium"}],"cwes":["CWE-706"],"updated_at":"2026-11-02T14:39:10.178331Z"}],"nvd":[{"id":"CVE-2025-13437","description":"When zx is invoked with --prefer-local=\u003cpath\u003e, the CLI creates a symlink named ./node_modules pointing to \u003cpath\u003e/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 \u003cpath\u003e/node_modules outside the current working directory.","status":"published","published":"2025-11-20T17:15:49.453Z","modified":"2026-10-18T20:10:00.11Z","cvss":[{"version":"4.0","score":5.6,"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/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","level":"medium","assessor":"secondary"}],"cwes":["CWE-706"],"updated_at":"2026-11-02T14:11:46.009629Z"}],"osv":[{"id":"CVE-2025-13437","title":"Arbitrary node_modules Directory Deletion in Google zx","description":"When zx is invoked with --prefer-local=\u003cpath\u003e, the CLI creates a symlink named ./node_modules pointing to \u003cpath\u003e/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 \u003cpath\u003e/node_modules outside the current working directory.","status":"published","published":"2025-11-20T16:25:16.866Z","modified":"2026-10-28T02:31:02.661947995Z","cvss":[{"version":"4.0","score":5.6,"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","level":"medium"}],"cwes":["CWE-706"],"updated_at":"2026-11-02T15:44:46.340268Z"},{"id":"GHSA-w87r-vg9q-crqm","title":"zx Uses Incorrectly-Resolved Name or Reference","description":"When zx is invoked with --prefer-local=\u003cpath\u003e, the CLI creates a symlink named ./node_modules pointing to \u003cpath\u003e/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 \u003cpath\u003e/node_modules outside the current working directory.","status":"published","published":"2025-11-20T18:31:01Z","modified":"2025-11-21T18:44:00.001863Z","cvss":[{"version":"4.0","score":5.6,"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","level":"medium"}],"cwes":["CWE-706"],"updated_at":"2026-11-02T15:46:58.401149Z"}]}}
