Vulnerabilities in pkg:npm/zx

PACKAGE
Advisory Identifier: GHSA-w87r-vg9q-crqm
Advisory Summary

CVE-2025-13437 is a MODERATE zx uses incorrectly-resolved name or vulnerability (CWE-706: Use of Incorrectly-Resolved Name or Reference) affecting Zx libraries in the npm ecosystem. The issue involves zx uses incorrectly-resolved name or reference. Remediation is available by upgrading affected packages to version 8.8.5.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/zx

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/zx. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-w87r-vg9q-crqm CVE-2025-13437 MODERATE zx Uses Incorrectly-Resolved Name or Reference
GHSA-qwp8-x4ff-5h87 CVE-2025-24959 MODERATE ZX Allows Environment Variable Injection for dotenv API

CVE-2025-13437 at a Glance

CVE Identifier CVE-2025-13437
GHSA Identifier GHSA-w87r-vg9q-crqm
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-706: Use of Incorrectly-Resolved Name or Reference
Affected Product Zx
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2025-13437

To remediate this vulnerability, upgrade all affected Zx dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

zx fixed: 8.8.5
npm install zx@8.8.5
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls zx

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2025-13437, inspect your project dependencies using npm:

npm ls zx

Analyze the terminal output to locate any version of Zx in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 8.8.5), your application is affected.

Note: The npm ls zx command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-706: Use of Incorrectly-Resolved Name or Reference, where the product uses a name or reference to access a resource, but the name/reference resolves to a resource that is outside of the intended control sphere. In Zx, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

CVE-2025-13437 Affected Zx Versions

1 component(s)
Fixed Versions:
8.8.5
Product / Package Ecosystem Affected Versions Fixed Version
zx
npm
< 8.8.5
8.8.5

References

Frequently Asked Questions

What is CVE-2025-13437?
CVE-2025-13437 is a security vulnerability in Zx involving zx Uses Incorrectly-Resolved Name or Reference under CWE-706: Use of Incorrectly-Resolved Name or Reference.
Which Zx versions are affected?
Affected versions include releases prior to 8.8.5 across affected packages: zx.
What version fixes CVE-2025-13437?
Upgrading to 8.8.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is zx affected?
Yes, zx is affected in releases prior to 8.8.5. Upgrade your dependency to 8.8.5 or later.
What CWE is associated with CVE-2025-13437?
CVE-2025-13437 is classified under CWE-706: Use of Incorrectly-Resolved Name or Reference (The product uses a name or reference to access a resource, but the name/reference resolves to a resource that is outside of the intended control sphere.).
How can I check npm dependencies for CVE-2025-13437?
Run the dependency tree command: 'npm ls zx'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-w87r-vg9q-crqm",
  "modified" : "2025-11-21T18:01:32Z",
  "published" : "2025-11-20T18:31:01Z",
  "aliases" : [ "CVE-2025-13437" ],
  "summary" : "zx Uses Incorrectly-Resolved Name or Reference",
  "details" : "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.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "zx"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "8.8.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-13437"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/google/zx/issues/1348"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/google/zx/pull/1349"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/google/zx/pull/1355"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/google/zx/commit/9ef6d3c9962c4ba01e3fb8075855570c192b4681"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/google/zx/commit/a4d1bc2467f305f1c91d62506e215f307dc1fbeb"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/google/zx"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-706" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-11-21T18:01:32Z",
    "nvd_published_at" : "2025-11-20T17:15:49Z"
  }
}