CVE-2021-39134: UNIX Symbolic Link (Symlink) Following in @npmcli/arborist
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.
Not severe (CVSS 8.2, local access); no exploitation reported by the 5 checked sources
Source freshness unavailable
How is this decided?Advisory lineage
Upstream 0 · Downstream 9 · Related 8Timeline
- 31-08-2021PublishedVulnerability first disclosed.
- 04-08-2024Last 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- OSV · AlpineEcosystem advisory · calculated7.8HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:HDiffers
- OSV · UbuntuEcosystem advisory · calculated7.8HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:HDiffers
- OSV · DebianEcosystem advisory · calculated7.8HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:HDiffers
- OSV · NpmEcosystem advisory · calculated8.2HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N
- NVDNIST7.8HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:HDiffers
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
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root cause- CWE-61UNIX Symbolic Link (Symlink) FollowingThe product, when opening a file or directory, does not sufficiently account for when the file is a symbolic link that resolves to a target outside of the intended control sphere. This could allow an attacker to cause the product to operate on unauthorized files.
- CWE-178Improper Handling of Case SensitivityThe product does not properly account for differences in case sensitivity when accessing or determining the properties of a resource, leading to inconsistent results.
Affected systems
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
- arborist< 2.8.2
Npmjs1 product
- arborist< 2.8.2
Oracle1 product
- graalvmEOL20.3.3 | 21.2.0
Siemens1 product
Ubuntu1 product
- npmAll versions (No fix recorded)
8 vendors · 8 products
References
11 links- github.com/npm/arborist/security/advisories/GHSA-2h3h-q99f-3fhcX Refsource CONFIRMREPORTWEBMitigationThird Party Advisory
- www.npmjs.com/package/%40npmcli/arboristX Refsource MISC
- cert-portal.siemens.com/productcert/pdf/ssa-389290.pdfX Refsource CONFIRMWEBPatchThird Party Advisory
Show all 11 references
- github.com/npm/arboristPACKAGE