LiveActive security incident?Get immediate response
CVE Record

CVE-2021-39135: UNIX Symbolic Link (Symlink) Following in @npmcli/arborist

`@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.

HighCVSS 8.2Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

A flaw in npm’s Arborist library could let dependency installation write files outside the intended project folder if a node_modules directory is replaced by a symbolic link. This threatens developer workstations and CI build systems more than production web servers. The published fix is Arborist 2.8.2, included in npm 7.20.7 and later.

Executive priority

Treat as a high-priority build-system hygiene issue. It is not described as remotely exploitable production compromise, but compromised developer or CI environments can create broader supply-chain risk. Prioritize upgrades in CI images and developer baselines.

Technical view

@npmcli/arborist before 2.8.2 may follow a symlinked node_modules path while extracting dependency contents, allowing writes to arbitrary filesystem locations. The issue is CWE-61 with CVSS 8.2. Sources note package-contained symlinks are filtered, so exploitation requires another way to create the node_modules symlink and user interaction.

Likely exposure

Exposure is most likely where npm v7 before 7.20.7 or @npmcli/arborist before 2.8.2 is used on developer machines, CI runners, or build automation. Risk increases when teams install dependencies from untrusted repositories or run package lifecycle scripts without isolation.

Exploitation context

The source bundle does not support active exploitation, and KEV is false. Exploitation requires local install activity and user interaction. Sources describe possible setup through lifecycle script behavior or a supplied repository, but they also note package artifact symlinks are filtered.

Researcher notes

The key boundary failure is Arborist writing through a symlinked node_modules path despite intended extraction confinement. Evidence is strongest for npm Arborist versions below 2.8.2. Downstream Oracle and Siemens references should be read as vendor-specific advisories, not proof that all their products are affected.

Mitigation direction

  • Upgrade npm to 7.20.7 or later where npm v7 is used.
  • Upgrade direct @npmcli/arborist usage to 2.8.2 or later.
  • Disable package install scripts where feasible for untrusted dependency work.
  • Avoid installing dependencies from untrusted repositories on privileged developer or CI systems.
  • Check Oracle and Siemens advisories if their products are in scope.
  • Review vendor guidance before applying product-specific mitigations.

Validation and detection

  • Inventory npm versions on developer endpoints and CI images.
  • Identify projects or tooling using @npmcli/arborist below 2.8.2.
  • Check build logs and images for npm v7 earlier than 7.20.7.
  • Review dependency installation workflows for untrusted repository handling.
  • Verify node_modules is not a symlink before sensitive dependency installation.
  • Confirm downstream vendor advisories apply before tracking them as affected.
Prepared
Confidence
high
Sources
6

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · low confidence lookup

CWE-61: Exact CWE lookup

Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2021-39135 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
High
CVSS
8.2 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
0Timeline events
0ADP providers
5Source links

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
8.2CVSS 3.1HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N1.85.8Primary CVE score

Vulnerability scoring details

Base CVSS 3.1 score

8.2High
CVSS 3.1 vector shape for CVE-2021-39135Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone
Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
npmarborist< 2.8.2Listed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-61 · source CWE mapping

UNIX Symbolic Link (Symlink) Following

UNIX Symbolic Link (Symlink) Following represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.