CVE-2021-39135
UNIX Symbolic Link (Symlink) Following in @npmcli/arborist
Also known as GHSA-gmw6-94gg-2rc2
Mitigation
- Upgrade @npmcli/arborist to 2.8.2 or later.
Who should check
- Projects that depend on npm package @npmcli/arborist (< 2.8.2)
- Anyone running npm arborist < 2.8.2
Vulnerability facts
- Affected
- @npmcli/arborist < 2.8.2
- Fixed in
- 2.8.2
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Not remotely exploitable (local or adjacent access needed)
- CVSS
- 8.2 (v3.1, CNA)CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:NOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Local
- Attack complexity: Low
- Privileges required: None
- User interaction: Required
- Scope: Changed (impact reaches other components)
- Confidentiality impact: High
- Integrity impact: High
- Availability impact: None
- EPSS
- 0.57% chance of exploitation in 30 days (percentile 41, 2026-11-26)
- CWE
- CWE-61
- Modified
Description
`@npmcli/arborist`, the library that calculates dependency trees and manages the node_modules folder hierarchy for the npm command line interface, aims to guarantee that package dependency contracts will be met, and the extraction of package contents will always be performed into the expected folder. This is accomplished by extracting package contents into a project's `node_modules` folder. If the `node_modules` folder of the root project or any of its dependencies is somehow replaced with a symbolic link, it could allow Arborist to write package dependencies to any arbitrary location on the file system. Note that symbolic links contained within package artifact contents are filtered out, so another means of creating a `node_modules` symbolic link would have to be employed. 1. A `preinstall` script could replace `node_modules` with a symlink. (This is prevented by using `--ignore-scripts`.) 2. An attacker could supply the target with a git repository, instructing them to run `npm install --ignore-scripts` in the root. This may be successful, because `npm install --ignore-scripts` is typically not capable of making changes outside of the project directory, so it may be deemed safe. This is patched in @npmcli/arborist 2.8.2 which is included in npm v7.20.7 and above. For more information including workarounds please see the referenced GHSA-gmw6-94gg-2rc2.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| npm @npmcli/arborist | < 2.8.2 | 2.8.2 | osv |
| npm arborist | < 2.8.2 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2021-39135. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2021-39135.md Affected: @npmcli/arborist < 2.8.2 Fixed in: 2.8.2 Steps: 1. Search this machine and project for @npmcli/arborist (npm), npm arborist: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
Patches
FAQ
Is CVE-2021-39135 being exploited?
There is no confirmed exploitation: CVE-2021-39135 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.57% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2021-39135?
High: CVSS 8.2 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed). A user has to take an action, such as opening a link, for the attack to work.
Which versions are affected by CVE-2021-39135?
@npmcli/arborist < 2.8.2.
Is there a fix for CVE-2021-39135?
Yes. Fixed in 2.8.2. Upgrade @npmcli/arborist to 2.8.2 or later.
How do I check if I'm affected by CVE-2021-39135?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.