CVE-2025-13437
JSON

5.6medium

Arbitrary node_modules Directory Deletion in Google zx

Severity
5.6medium CVSS:4.0 by Google
Exploit likelihood
0.09% (higher than 0% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
Google
Also known as
GHSA-w87r-vg9q-crqm

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.

Affected

Product or packageVersionsReported by
Google zx8.8.4CVE List
zx (npm)before 8.8.5GitHub Advisory Database

All scores

Google5.6medium CVSS:4.0CVSS: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
GitHubmedium CVSS:4.0CVSS: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

Classification

CWE-706

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.

What each source says

CVE List

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.

NVD (es)

Cuando zx es invocado con --prefer-local=<path>, la CLI crea un enlace simbólico llamado ./node_modules apuntando a <path>/node_modules. Debido a un error de lógica en src/cli.ts (linkNodeModules / cleanup), la función devuelve la ruta de destino en lugar del alias (ruta del enlace simbólico). La rutina de limpieza posterior elimina lo que recibió, lo que elimina el propio directorio de destino. Resultado: zx puede eliminar un <path>/node_modules externo fuera del directorio de trabajo actual.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-13437 changed 2025-11-20CVE Terms of Use
GitHub Advisory DatabaseGHSA-w87r-vg9q-crqm changed 2025-11-21CC-BY-4.0
NVDCVE-2025-13437 changed 2026-10-18Public domain