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

- Severity: Medium 5.6 (CVSS:4.0, scored by Google) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.09%, higher than 0% of CVEs (2026-12-01)
- Published: 2025-11-20T16:25:16.866Z
- Modified: 2026-10-18T20:10:00.110Z
- Also known as: GHSA-w87r-vg9q-crqm
- Weaknesses: CWE-706
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: Google

## 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.

(As written by CVE List.)

## Affected

- Google zx: 8.8.4
- zx (npm): before 8.8.5

## Every score

- Google: CVSS:4.0 5.6 Medium `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`
- GitHub: CVSS:4.0 Medium `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

- <https://github.com/google/zx/issues/1348> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2025-13437> (advisory)
- <https://github.com/google/zx/pull/1349> (web)
- <https://github.com/google/zx/pull/1355> (web)
- <https://github.com/google/zx/commit/9ef6d3c9962c4ba01e3fb8075855570c192b4681> (web)
- <https://github.com/google/zx/commit/a4d1bc2467f305f1c91d62506e215f307dc1fbeb> (web)
- <https://github.com/google/zx> (package)

## Sources

- CVE List: [CVE-2025-13437](https://www.cve.org/CVERecord?id=CVE-2025-13437), CVE Terms of Use, modified 2025-11-20
- GitHub Advisory Database: [GHSA-w87r-vg9q-crqm](https://github.com/advisories/GHSA-w87r-vg9q-crqm), CC-BY-4.0, modified 2025-11-21
- NVD: [CVE-2025-13437](https://nvd.nist.gov/vuln/detail/CVE-2025-13437), Public domain, modified 2026-10-18

---

Page: https://cve.day/CVE-2025-13437 · Whole record: https://cve.day/CVE-2025-13437.json · Rebuilt by cve.day 2026-11-25T22:59:07.871Z
