Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2025-13437: CWE-706 Use of Incorrectly-Resolved Name or Reference in Google zx

0
Medium
VulnerabilityCVE-2025-13437cvecve-2025-13437cwe-706
Published: Thu Nov 20 2025 (11/20/2025, 16:25:16 UTC)
Source: CVE Database V5
Vendor/Project: Google
Product: zx

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.

AI-Powered Analysis

AILast updated: 11/20/2025, 16:54:52 UTC

Technical Analysis

CVE-2025-13437 is a vulnerability identified in Google zx version 8.8.4, a tool designed to simplify scripting with JavaScript and Node.js. The issue arises when the zx CLI is invoked with the --prefer-local=<path> option. This option causes zx to create a symbolic link named ./node_modules pointing to <path>/node_modules. Due to a logic error in the source code (specifically in src/cli.ts within the linkNodeModules and cleanup functions), the function responsible for cleanup returns the target path of the symlink rather than the symlink alias path itself. Consequently, the cleanup routine deletes the target directory (<path>/node_modules) instead of just removing the symlink. This results in the unintended deletion of an external node_modules directory outside the current working directory, potentially removing critical dependencies or shared modules. The vulnerability is classified under CWE-706 (Use of Incorrectly-Resolved Name or Reference), indicating a flaw in path resolution logic. Exploitation requires local access and user interaction (invoking zx with the specific option), but no elevated privileges or authentication are necessary. The impact primarily affects the integrity and availability of external dependencies, which can disrupt development workflows, continuous integration, and deployment pipelines. Although no known exploits are reported in the wild, the vulnerability poses a risk to environments where zx is used with the --prefer-local option pointing to important shared directories. The CVSS 4.0 vector score is 5.6 (medium severity), reflecting the local attack vector, low complexity, no privileges required, but user interaction needed and high impact on integrity and availability.

Potential Impact

For European organizations, the vulnerability could lead to accidental or malicious deletion of critical node_modules directories outside the intended scope, causing disruption in software development and deployment processes. This can result in downtime for development teams, broken builds, and delays in production releases. Organizations relying on shared or centralized node_modules directories in monorepos or CI/CD environments are particularly at risk. The integrity of development environments is compromised, potentially leading to loss of dependencies and increased recovery time. Availability of development tools and pipelines may be affected, impacting productivity and operational continuity. While the vulnerability does not directly expose sensitive data or allow remote code execution, the disruption to development workflows can have downstream effects on business operations and security posture. European companies with large software engineering teams or those using Google zx in automated scripts should prioritize assessment and mitigation to avoid operational impact.

Mitigation Recommendations

To mitigate CVE-2025-13437, organizations should avoid using the --prefer-local option with Google zx version 8.8.4 until a patched version is available. If usage is necessary, ensure that the <path> specified does not point to critical or shared node_modules directories outside isolated environments. Implement strict filesystem permissions and access controls to limit the ability of scripts to delete important directories. Use containerized or sandboxed environments for running zx scripts to contain potential damage. Monitor filesystem changes in development and CI/CD environments to detect unexpected deletions promptly. Regularly back up node_modules directories or use package-lock.json and package manifests to quickly restore dependencies. Stay updated with Google zx releases and apply patches once available. Additionally, conduct code reviews and static analysis on scripts invoking zx with --prefer-local to identify risky usage patterns. Educate developers about the risks of this option and enforce usage policies accordingly.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.2
Assigner Short Name
Google
Date Reserved
2025-11-19T19:03:28.234Z
Cvss Version
4.0
State
PUBLISHED

Threat ID: 691f4446d2e902043d1f9194

Added to database: 11/20/2025, 4:39:34 PM

Last enriched: 11/20/2025, 4:54:52 PM

Last updated: 11/20/2025, 9:42:46 PM

Views: 7

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats