CVE-2025-13437

Arbitrary node_modules Directory Deletion in Google zx

Published Nov 20, 2025 CVSS 4.0 · 5.6 Medium EPSS < 1% KEV · Not listed
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.

Remediation

No solution or workaround provided in the CVE record

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-w87r-vg9q-crqm zx Uses Incorrectly-Resolved Name or Reference
History
Type Values Removed Values Added
First Time appeared Google
Google zx
Vendors & Products Google
Google zx
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

Type Values Removed Values Added
Metrics ssvc

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

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'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
Google
Published
Updated
Nov 20, 2025, 4:49 PM
Reserved
Nov 19, 2025, 7:03 PM
Status
Deferred
Published
Nov 20, 2025, 5:15 PM
Modified
Oct 18, 2026, 8:10 PM
Severity
Moderate
Public date
Nov 20, 2025, 4:25 PM