Nx: Zip-Slip in the self-hosted remote cache
nrwl nx
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| nx npm |
|
|
| @nx/s3-cache npm |
| No fix yet |
| @nx/gcs-cache |
nrwl nx
| Product | Affected | Fixed in |
|---|---|---|
| nx npm |
|
|
| @nx/s3-cache npm |
| No fix yet |
| @nx/gcs-cache |
|
| No fix yet |
| @nx/azure-cache npm |
| No fix yet |
| @nx/shared-fs-cache npm |
| No fix yet |
| @nx/powerpack-s3-cache npm |
| No fix yet |
| @nx/powerpack-gcs-cache npm |
| No fix yet |
| @nx/powerpack-azure-cache npm |
| No fix yet |
| @nx/powerpack-shared-fs-cache npm |
| No fix yet |
Nx is a monorepo solution for TypeScript and polyglot codebases. From version 20.8.0 until 22.7.7 and 23.0.2, the Nx self-hosted HTTP remote cache extracts downloaded cache artifacts without constraining where files are written. A malicious or on-path (MITM) remote cache server can return a crafted tar archive whose entries escape the cache directory and write to arbitrary locations on the machine running Nx, which can be escalated to remote code execution. Nx's default local cache and Nx Cloud are not affected; only workspaces configured to use a self-hosted remote cache are affected. This issue is fixed in versions 22.7.7 and 23.0.2.
From the CVE record · GitHub_M
Affected Nx versions extract artifacts from a self-hosted HTTP remote cache without restricting where files are written. A malicious or on-path remote cache server can supply a crafted archive that writes outside the cache directory, potentially leading to remote code execution. This requires a workspace configured to use a self-hosted remote cache; the default local cache and Nx Cloud are not affected.
Check workspaces using a self-hosted remote cache with npm nx >=20.8.0 <22.7.7 or >=23.0.0 <23.0.2, or any listed @nx/*-cache package at version 5.0.7 or earlier.