Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2021-39135

CVE-2021-39135: Npmjs Arborist Path Traversal Flaw

CVE-2021-39135 is a path traversal vulnerability in Npmjs Arborist that allows attackers to write package dependencies to arbitrary file system locations via symbolic links. This article covers technical details, impact, and mitigation.

Published: February 25, 2026

CVE-2021-39135 Overview

CVE-2021-39135 is a symlink attack vulnerability in @npmcli/arborist, the library that calculates dependency trees and manages the node_modules folder hierarchy for the npm command line interface. The library aims to guarantee that package dependency contracts will be met and that package contents extraction will always be performed into the expected folder. However, if the node_modules folder of the root project or any of its dependencies is replaced with a symbolic link, it could allow Arborist to write package dependencies to any arbitrary location on the file system.

Critical Impact

This vulnerability enables arbitrary file write through symlink manipulation, potentially allowing attackers to overwrite system files or inject malicious code outside the project directory.

Affected Products

  • npmjs Arborist (versions prior to 2.8.2)
  • npmjs npm (versions prior to 7.20.7)
  • Oracle GraalVM Enterprise Edition (20.3.3 and 21.2.0)
  • Siemens SINEC Infrastructure Network Services

Discovery Timeline

  • 2021-08-31 - CVE-2021-39135 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2021-39135

Vulnerability Analysis

This vulnerability is classified as a symlink attack (CWE-61, CWE-59), which falls under the category of UNIX Symbolic Link (Symlink) Following vulnerabilities. The issue arises from improper validation of symbolic links during package installation operations.

Arborist normally extracts package contents into a project's node_modules folder with the expectation that this folder is a legitimate directory within the project structure. While symbolic links contained within package artifact contents are filtered out during extraction, the library fails to validate whether the node_modules folder itself has been replaced with a symbolic link pointing to an external location.

When Arborist encounters a symlink masquerading as the node_modules directory, it follows the symlink and writes package contents to the arbitrary target location. This behavior can be exploited to write files outside the intended project directory, potentially overwriting critical system files or injecting malicious code into sensitive locations.

Root Cause

The root cause of this vulnerability is insufficient validation of the node_modules directory before performing write operations. The Arborist library trusts that the node_modules folder is a legitimate directory without verifying whether it might be a symbolic link pointing elsewhere on the file system. While the library correctly filters symbolic links within package contents, it fails to apply the same security check to the target installation directory itself.

Attack Vector

The attack requires local access and user interaction, as described in two primary exploitation scenarios:

Scenario 1: Malicious preinstall script
A malicious package can include a preinstall script that replaces the node_modules folder with a symlink to an arbitrary location before Arborist writes package contents. This attack is prevented when using the --ignore-scripts flag.

Scenario 2: Malicious git repository
An attacker could provide a victim with a crafted git repository and instruct them to run npm install --ignore-scripts in the root. This attack is particularly deceptive because npm install --ignore-scripts is typically considered safe since it's not expected to make changes outside the project directory. However, if the repository already contains a node_modules symlink pointing to an external location, Arborist will follow it and write dependencies to the attacker-controlled path.

The vulnerability manifests in the directory resolution and file writing operations within Arborist's package extraction logic. When the library resolves the node_modules path, it does not check whether the path is a symbolic link, allowing the symlink traversal to occur during subsequent write operations. For detailed technical information, refer to the GitHub Security Advisory GHSA-gmw6-94gg-2rc2.

Detection Methods for CVE-2021-39135

Indicators of Compromise

  • Presence of symbolic links in project node_modules directories pointing to locations outside the project tree
  • Unexpected file modifications in system directories or sensitive locations following npm install operations
  • npm or Arborist versions older than the patched versions (npm < 7.20.7 or @npmcli/arborist < 2.8.2)
  • Suspicious preinstall scripts in package.json files that manipulate directory structures

Detection Strategies

  • Monitor file system operations during npm install for writes outside the project directory
  • Implement file integrity monitoring (FIM) on sensitive system directories to detect unexpected modifications
  • Scan project repositories for pre-existing node_modules symbolic links before running npm install
  • Use software composition analysis (SCA) tools to identify vulnerable versions of npm and Arborist

Monitoring Recommendations

  • Enable audit logging for npm operations and review for anomalous directory traversal patterns
  • Deploy endpoint detection and response (EDR) solutions that can detect symlink-based file system manipulation
  • Implement CI/CD pipeline checks that validate repository contents before executing npm install commands
  • Monitor for the creation of symbolic links in project directories, especially those named node_modules

How to Mitigate CVE-2021-39135

Immediate Actions Required

  • Upgrade @npmcli/arborist to version 2.8.2 or later
  • Upgrade npm to version 7.20.7 or later
  • Review and audit any projects that may have been installed using vulnerable versions
  • Inspect existing repositories for suspicious node_modules symbolic links before running npm install

Patch Information

The vulnerability is patched in @npmcli/arborist version 2.8.2, which is included in npm version 7.20.7 and above. Organizations using Oracle GraalVM should consult the Oracle CPU October 2021 Security Alert for specific patch guidance. For Siemens SINEC Infrastructure Network Services users, refer to the Siemens Security Advisory SSA-389290 for remediation instructions.

Workarounds

  • Always use --ignore-scripts flag when installing packages from untrusted sources to prevent malicious preinstall scripts from creating symlinks
  • Manually verify that node_modules is not a symbolic link before running npm install on untrusted repositories
  • Use isolated environments (containers, VMs) when working with untrusted npm packages to limit potential damage from arbitrary file writes
  • Implement pre-install hooks in your development workflow to check for and remove suspicious symbolic links
bash
# Verify node_modules is not a symlink before installation
if [ -L "node_modules" ]; then
    echo "WARNING: node_modules is a symbolic link!"
    ls -la node_modules
    exit 1
fi

# Safe installation with scripts disabled
npm install --ignore-scripts

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypePath Traversal

  • Vendor/TechNpmjs Arborist

  • SeverityHIGH

  • CVSS Score7.8

  • EPSS Probability0.21%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityHigh
  • AvailabilityHigh
  • CWE References
  • CWE-61

  • CWE-59
  • Technical References
  • GitHub Security Advisory GHSA-gmw6-94gg-2rc2

  • npm Package Overview for Arborist
  • Vendor Resources
  • Siemens Security Advisory SSA-389290

  • Oracle CPU October 2021 Security Alert
  • Latest CVEs
  • CVE-2025-11419: Keycloak TLS DoS Vulnerability

  • CVE-2025-13947: WebKitGTK Information Disclosure Flaw

  • CVE-2026-40322: SiYuan Knowledge Management RCE Vulnerability

  • CVE-2026-40318: SiYuan Path Traversal Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English