Quick answers
- Is CVE-2021-39135 exploited in the wild?
- No. Junglewise Threat Intelligence has no report of CVE-2021-39135 being exploited in the wild.
- How severe is CVE-2021-39135?
- Low severity, with a CVSS score of 3.1, published 31 August 2021.
- Which products and versions are affected?
- @npmcli/arborist (npm) <2.8.2.
- Is there a fix for CVE-2021-39135?
- A patch was published on 2021-08-31: Version 2.8.2 released; included in npm v7.20.7+ Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
- How is CVE-2021-39135 attacked?
- It is attacked with local access, in a software library.
- Am I affected by CVE-2021-39135?
- Check whether you run @npmcli/arborist (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.
Technical details
The vulnerability is a symlink following issue (CWE-61, CWE-59) in @npmcli/arborist, the npm package dependency tree calculator and node_modules manager. When arborist extracts package contents into node_modules, it does not verify that node_modules is a real directory rather than a symbolic link; if node_modules is a symlink, arborist will follow it and write packages to an arbitrary filesystem location. An attacker can exploit this by supplying a malicious git repository and tricking a developer into running npm install, or by using a preinstall script to replace node_modules with a symlink. The attack requires local access and user interaction (developer running npm install), but achieves arbitrary file creation, overwrite, and potential code execution. Fixed in version 2.8.2 (included in npm v7.20.7+); the fix validates that node_modules is a real directory before extracting packages.
Affected products
- npm @npmcli/arborist <2.8.2
Identifiers
- CVE-2021-39135
- GHSA-gmw6-94gg-2rc2
Timeline
- 2021-08-31: disclosed: GHSA-gmw6-94gg-2rc2 published
- 2021-08-31: patched: Version 2.8.2 released; included in npm v7.20.7+