Skip to content
Fencer Vulns
high 8.2

CVE-2021-39134 json

UNIX Symbolic Link (Symlink) Following in @npmcli/arborist

published 2021-08-31 5 y ago modified 2026-07-08 4 mo ago also GHSA-2h3h-q99f-3fhc , EUVD-2021-1513

cvss
8.2
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
0.6%
EPSS 0.6% chance of exploitation in 30 days, percentile 48%
public exploits
0
none known

Summary

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

Patch / fix

  • npm @npmcli/arborist 2.8.2
  • npmjs arborist 2.8.2
  • siemens sinec_infrastructure_network_services 1.0.1.1
  • npm Debian 14, Debian 13, Debian 12 7.24.0+ds-2

debian advisories DEBIAN-CVE-2021-39134

  • nodejs12 SLE Module for Web and Scripting 12 12.22.9-1.38.1
  • nodejs14 SLE Module for Web and Scripting 15 SP3, SLE Module for Web and Scripting 15 SP2 14.18.1-15.21.2
  • nodejs12 SLE Module for Web and Scripting 15 SP3, SLE Module for Web and Scripting 15 SP2 12.22.7-4.22.1
  • nodejs14 SLE Module for Web and Scripting 12 14.18.1-6.18.2

suse advisories SUSE-SU-2022:0101-1SUSE-SU-2021:3964-1SUSE-SU-2021:3940-1SUSE-SU-2021:3886-1

  • nodejs12 openSUSE Leap 15.2 12.22.7-lp152.3.21.1
  • nodejs14 openSUSE Leap 15.2 14.18.1-lp152.17.1
  • nodejs14 openSUSE Leap 15.3 14.18.1-15.21.2
  • nodejs12 openSUSE Leap 15.3 12.22.7-4.22.1

opensuse advisories openSUSE-SU-2021:1574-1openSUSE-SU-2021:1552-1openSUSE-SU-2021:3964-1openSUSE-SU-2021:3940-1

  • nodejs Alpine 3.12, Alpine 3.11 12.22.6-r0
  • nodejs Alpine 3.24, Alpine 3.23, Alpine 3.22 +9 more 14.17.6-r0

alpine advisories ALPINE-CVE-2021-39134

Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2021-39134 updated cvss 8.1

nodejs-arborist: symlink following vulnerability

  • Red Hat Enterprise Linux 8 npm, nodejs, nodejs-libs, nodejs-nodemon, nodejs-full-i18n, nodejs-packaging, +1 more Red Hat Enterprise Linux 9 npm, nodejs, nodejs-libs, nodejs-full-i18n Red Hat Software Collections rh-nodejs12-npm, rh-nodejs14-npm, rh-nodejs12-nodejs, rh-nodejs14-nodejs, rh-nodejs14-nodejs-full-i18n
    not affected: vulnerable code not present

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

Exploit prediction

0.59% chance of exploitation in the next 30 days, higher than 48% of all scored CVEs (FIRST EPSS, 2026-11-08).

CVSS scores

assigned by version score vector
CNA 3.1 8.2 CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N
NVD 3.1 7.8 CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
NVD 2.0 4.4 AV:L/AC:M/Au:N/C:P/I:P/A:P
GitHub 3.1 8.2 CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N

Affected packages

ecosystem package affected fixed in
npm @npmcli/arborist
<2.8.2
2.8.2

Affected products

  • npm arborist

Classification

Weakness
  • CWE-61 UNIX Symbolic Link (Symlink) Following
  • CWE-178 Improper Handling of Case Sensitivity
  • CWE-59 Improper Link Resolution Before File Access

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.