Skip to content
Fencer Vulns
high 8.2

CVE-2021-39135 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-gmw6-94gg-2rc2 , EUVD-2021-1724

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 47%
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 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.

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-39135

  • 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

  • nodejs14 openSUSE Tumbleweed 14.18.1-1.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-2024:11616-1openSUSE-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-39135

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-39135 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.56% chance of exploitation in the next 30 days, higher than 47% 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-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.