CVE-2021-39135
JavaScript vulnerability analysis and mitigation

Overview

@npmcli/arborist, the library that calculates dependency trees and manages the nodemodules folder hierarchy for the npm command line interface, was found to have a vulnerability that could allow arbitrary file creation and overwrite. The vulnerability (CVE-2021-39135) was discovered in August 2021 and affects versions up to 2.8.1. The issue occurs when the nodemodules folder of the root project or any of its dependencies is replaced with a symbolic link, potentially allowing writes to arbitrary locations on the file system (GitHub Advisory).

Technical details

The vulnerability stems from the way @npmcli/arborist handles symbolic links in nodemodules folders. While symbolic links contained within package artifact contents are filtered out, other means of creating a nodemodules symbolic link could be exploited. Two main attack vectors were identified: 1) A preinstall script could replace node_modules with a symlink (though this can be prevented using --ignore-scripts), 2) An attacker could supply a git repository and instruct the target to run npm install --ignore-scripts in the root, which might be considered safe since it typically cannot make changes outside the project directory (GitHub Advisory).

Impact

Successful exploitation of this vulnerability could allow an attacker to write package dependencies to any arbitrary location on the file system, potentially leading to arbitrary code execution through file overwrites (SecurityWeek).

Mitigation and workarounds

The vulnerability was patched in @npmcli/arborist version 2.8.2, which is included in npm v7.20.7 and above. As a workaround, users should not run npm install on untrusted codebases without first ensuring that the nodemodules directory in the project is not a symbolic link. The fix verifies that the nodemodules folder is a real directory before extracting package contents (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-67731HIGH8.7
  • JavaScriptJavaScript
  • servify-express
NoYesDec 12, 2025
CVE-2025-67718HIGH8.7
  • JavaScriptJavaScript
  • formio
NoYesDec 11, 2025
CVE-2025-8083HIGH8.6
  • JavaScriptJavaScript
  • vuetify
NoYesDec 12, 2025
CVE-2025-67750HIGH8.4
  • JavaScriptJavaScript
  • lightning-flow-scanner
NoYesDec 12, 2025
CVE-2025-8082MEDIUM6.3
  • JavaScriptJavaScript
  • vuetify
NoYesDec 12, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management