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

No advisories yet.

Fixes

Solution

No solution given by the vendor.


Workaround

No workaround given by the vendor.

History

Fri, 21 Nov 2025 00:15:00 +0000

Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

{'score': 6.1, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L'}

threat_severity

Moderate


Thu, 20 Nov 2025 17:15:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Thu, 20 Nov 2025 16:30:00 +0000

Type Values Removed Values Added
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.
Title Arbitrary node_modules Directory Deletion in Google zx
Weaknesses CWE-706
References
Metrics cvssV4_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'}


cve-icon MITRE

Status: PUBLISHED

Assigner: Google

Published:

Updated: 2025-11-20T16:49:32.470Z

Reserved: 2025-11-19T19:03:28.234Z

Link: CVE-2025-13437

cve-icon Vulnrichment

Updated: 2025-11-20T16:49:26.587Z

cve-icon NVD

Status : Received

Published: 2025-11-20T17:15:49.453

Modified: 2025-11-20T17:15:49.453

Link: CVE-2025-13437

cve-icon Redhat

Severity : Moderate

Publid Date: 2025-11-20T16:25:16Z

Links: CVE-2025-13437 - Bugzilla

cve-icon OpenCVE Enrichment

No data.