LiveActive security incident?Get immediate response
CVE Record

CVE-2021-39134: 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, in part, accomplished by resolving dependency specifiers defined in `package.json` manifests for dependencies with a specific name, and nesting folders to resolve conflicting dependencies. When multiple dependencies differ only in the case of their name, Arborist's internal data structure saw them as separate items that could coexist within the same level in the `node_modules` hierarchy. However, on case-insensitive file systems (such as macOS and Windows), this is not the case. Combined with a symlink dependency such as `file:/some/path`, this allowed an attacker to create a situation in which arbitrary contents could be written to any location on the filesystem. For example, a package `pwn-a` could define a dependency in their `package.json` file such as `"foo": "file:/some/path"`. Another package, `pwn-b` could define a dependency such as `FOO: "file:foo.tgz"`. On case-insensitive file systems, if `pwn-a` was installed, and then `pwn-b` was installed afterwards, the contents of `foo.tgz` would be written to `/some/path`, and any existing contents of `/some/path` would be removed. Anyone using npm v7.20.6 or earlier on a case-insensitive filesystem is potentially affected. This is patched in @npmcli/arborist 2.8.2 which is included in npm v7.20.7 and above.

HighCVSS 8.2Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

This flaw affects npm’s dependency tree handling on case-insensitive filesystems. A malicious package install scenario could cause package contents to be written outside the intended node_modules location and remove existing contents there. The main business risk is developer or build-machine compromise through unsafe dependency installation.

Executive priority

Treat as high priority for development and build environments, especially where npm v7 is used on macOS or Windows. Patch promptly, but urgency is lower for systems that do not install packages or do not use affected versions.

Technical view

@npmcli/arborist before 2.8.2 treated dependencies differing only by case as separate nodes, while macOS and Windows filesystems may resolve them to the same path. Combined with symlink file dependencies, extraction could target unintended filesystem locations. npm v7.20.7 includes the patched Arborist version.

Likely exposure

Exposure is most likely on macOS or Windows developer workstations, CI runners, and build systems using npm v7.20.6 or earlier, or @npmcli/arborist below 2.8.2. Systems installing untrusted or compromised package dependency graphs carry the highest practical risk.

Exploitation context

The source bundle does not show CISA KEV listing or active exploitation evidence. Exploitation requires a package installation workflow and user interaction, so this is primarily a software supply-chain and build-environment risk rather than a remotely reachable service flaw.

Researcher notes

The vulnerability is CWE-61 symlink following with a filesystem case-collision condition. Keep validation focused on affected npm/Arborist versions, filesystem sensitivity, and package-install trust boundaries. Do not assume exploit activity without external evidence.

Mitigation direction

  • Upgrade npm to v7.20.7 or later.
  • Ensure @npmcli/arborist is 2.8.2 or later where separately pinned.
  • Restrict installation of untrusted packages on case-insensitive developer and build hosts.
  • Review vendor advisories for downstream products before assuming inherited exposure is fixed.

Validation and detection

  • Inventory npm versions on developer workstations and CI runners.
  • Check lockfiles and tooling for direct @npmcli/arborist versions below 2.8.2.
  • Prioritize macOS and Windows hosts, or any case-insensitive filesystem configuration.
  • Confirm package installation policies limit untrusted or unsigned dependency sources.
Prepared
Confidence
high
Sources
4

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-39134 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-39134Attack 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.