Bug 2416152 (CVE-2025-13437) - CVE-2025-13437 zx: Arbitrary node_modules Directory Deletion in Google zx
Summary: CVE-2025-13437 zx: Arbitrary node_modules Directory Deletion in Google zx
Keywords:
Status: NEW
Alias: CVE-2025-13437
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-11-20 17:01 UTC by OSIDB Bzimport
Modified: 2025-11-20 17:54 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2025-11-20 17:01:49 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.