`@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.
Published 2021-08-31 17:15:08
Updated 2022-08-12 17:49:55
Source GitHub, Inc.
View at NVD,   CVE.org

Products affected by CVE-2021-39134

Exploit prediction scoring system (EPSS) score for CVE-2021-39134

0.09%
Probability of exploitation activity in the next 30 days EPSS Score History
~ 41 %
Percentile, the proportion of vulnerabilities that are scored at or less

CVSS scores for CVE-2021-39134

Base Score Base Severity CVSS Vector Exploitability Score Impact Score Score Source First Seen
4.4
MEDIUM AV:L/AC:M/Au:N/C:P/I:P/A:P
3.4
6.4
NIST
7.8
HIGH CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
1.8
5.9
NIST
8.2
HIGH CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N
1.8
5.8
GitHub, Inc.

CWE ids for CVE-2021-39134

  • The 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.
    Assigned by: security-advisories@github.com (Secondary)
  • The product does not properly account for differences in case sensitivity when accessing or determining the properties of a resource, leading to inconsistent results.
    Assigned by: nvd@nist.gov (Primary)

References for CVE-2021-39134

Jump to
This web site uses cookies for managing your session, storing preferences, website analytics and additional purposes described in our privacy policy.
By using this web site you are agreeing to CVEdetails.com terms of use!