8.2

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

Modified
AliasesALPINE-CVE-2021-39134UBUNTU-CVE-2021-39134DEBIAN-CVE-2021-39134
Published 31-08-2021Last modified 04-08-2024

Vulnerability summary

CVE-2021-39134 is a high (CVSS 8.2) UNIX Symbolic Link (Symlink) Following vulnerability in npm arborist. EPSS estimates a 0.59% chance of exploitation in the next 30 days, higher than 48.1% of scored vulnerabilities.

Priority
Routine

Not severe (CVSS 8.2, local access); no exploitation reported by the 5 checked sources

Source freshness unavailable

How is this decided?
CVSS score
8.2/10
010
High · v3.1 (CVE.org)
EPSS score
0.59%
0%100%
Low · +0.01 pp in 30 days
KEVNot listedNot listed by any tracked catalog.
RansomwareNot flaggedNo ransomware use recorded.
Public exploits0No public exploits recorded

Advisory lineage

Upstream 0 · Downstream 9 · Related 8

Timeline

  1. 31-08-2021
    PublishedVulnerability first disclosed.
  2. 04-08-2024
    Last modifiedVulnerability information updated.

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, 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.

CVSS metrics

7 scores · 6 sources · 2 versions

EPSS trend

Probability

0.59%

Chance of exploitation in the next 30 days

Percentile

48%

Versus all other CVEs

30-day change

Increase +0.01 pp

From 0.58% on 04-10-2026

04-10-202603-11-2026

Known exploited

Compare KEV catalogs
CISA KEV

Not in the CISA KEV catalog.

ENISA CNW

Not in the ENISA CNW catalog.

CIRCL

Not in the CIRCL catalog.

Public exploits

0 found

No public exploits indexed.

Weaknesses

CWE · root cause

Affected systems

Version check

Known conditions: local access, no authentication, user interaction (CVSS vector). Other conditions: not stated in public data.

@npmcli1 product
  • arborist< 2.8.2
Alpine1 product
  • nodejs< 12.22.6-r0 | < 14.17.6-r0
Debian1 product
  • npm< 7.24.0+ds-2
Npm1 product
Npmjs1 product
Oracle1 product
Siemens1 product
Ubuntu1 product
  • npmAll versions (No fix recorded)

8 vendors · 8 products

References

11 links
Show all 11 references