The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
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
    • 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-2024-21891

CVE-2024-21891: Node.js Path Traversal Vulnerability

CVE-2024-21891 is a path traversal vulnerability in Node.js that allows attackers to bypass the filesystem permission model by overwriting built-in utility functions. This article covers technical details, affected versions, and mitigation.

Updated: January 22, 2026

CVE-2024-21891 Overview

CVE-2024-21891 is a path traversal vulnerability affecting Node.js that allows attackers to bypass the experimental permission model through the manipulation of built-in utility functions. Node.js relies on multiple built-in utility functions to normalize paths provided to node:fs functions. These utility functions can be overwritten with user-defined implementations, enabling attackers to craft malicious path strings that escape intended directory constraints.

Critical Impact

Attackers with low privileges can bypass filesystem permission restrictions to access, modify, or delete files outside the permitted directories, potentially compromising sensitive data or system integrity.

Affected Products

  • Node.js 20.x (with experimental permission model enabled)
  • Node.js 21.x (with experimental permission model enabled)

Discovery Timeline

  • 2024-02-20 - CVE-2024-21891 published to NVD
  • 2025-03-28 - Last updated in NVD database

Technical Details for CVE-2024-21891

Vulnerability Analysis

This vulnerability is classified as CWE-22 (Improper Limitation of a Pathname to a Restricted Directory) and exploits a fundamental design assumption in Node.js's experimental permission model. The permission model was introduced to allow applications to restrict access to specific filesystem paths, providing a sandboxing mechanism for untrusted code.

The core issue lies in how Node.js handles path normalization before enforcing permission checks. The node:fs module depends on built-in utility functions to normalize and resolve paths. However, these utility functions exist in JavaScript space and can be overwritten by user code before the permission checks occur. When an attacker replaces these normalization functions with malicious implementations, they can manipulate the path that gets validated versus the actual path that gets accessed.

This creates a classic time-of-check to time-of-use (TOCTOU) scenario where the permission model validates a safe-looking path, but the actual filesystem operation targets a completely different location through path traversal sequences like ../ that were hidden during validation.

Root Cause

The root cause is insufficient isolation between user-controllable JavaScript code and the internal utility functions used for path normalization in the permission model. The built-in functions that handle path operations can be monkey-patched by application code, and the permission enforcement mechanism does not adequately protect against such modifications.

When the permission model validates a path, it relies on these overwritable functions to normalize the input. An attacker who controls the normalization logic can ensure that validation sees an innocuous path while the actual file operation receives a traversal path targeting protected system files or directories.

Attack Vector

The attack requires network access and low privileges, meaning an attacker needs the ability to execute JavaScript code within the Node.js process. This could be achieved through:

  1. Exploiting an existing code injection vulnerability in a web application
  2. Providing malicious npm packages that modify built-in functions
  3. User-controlled input that gets evaluated as JavaScript

Once the attacker can execute code, they overwrite the path normalization utility functions. When legitimate application code subsequently attempts to access files through the node:fs module, the compromised normalization functions inject path traversal sequences, allowing access to files outside the permitted directories.

The attack is particularly dangerous because the experimental permission model creates a false sense of security—administrators may believe filesystem access is properly constrained when it can actually be bypassed through this mechanism.

Detection Methods for CVE-2024-21891

Indicators of Compromise

  • Unexpected modifications to Node.js built-in prototype functions or utility methods
  • Filesystem access logs showing access to paths containing ../ sequences or unexpected directory traversal
  • Application behavior accessing files outside configured permission boundaries
  • Anomalous file read/write operations targeting sensitive system files

Detection Strategies

  • Monitor for prototype pollution attempts targeting path-related functions in Node.js applications
  • Implement file integrity monitoring on systems running Node.js with the experimental permission model
  • Review application logs for path traversal patterns in filesystem operations
  • Deploy runtime application self-protection (RASP) solutions that can detect function hooking attempts

Monitoring Recommendations

  • Enable verbose logging for node:fs module operations in development and staging environments
  • Configure alerts for any filesystem access attempts to sensitive directories like /etc/, /root/, or Windows system directories
  • Monitor Node.js process behavior for signs of built-in function modification using security observability tools
  • Implement SentinelOne's Singularity platform to detect anomalous process behavior and file access patterns

How to Mitigate CVE-2024-21891

Immediate Actions Required

  • Upgrade Node.js to a patched version that addresses CVE-2024-21891
  • Audit applications using the experimental permission model for potential exposure
  • Review third-party dependencies for any code that modifies built-in utility functions
  • Consider disabling the experimental permission model until patches are applied if it is not critical to your application

Patch Information

Security patches addressing this vulnerability are available from the Node.js project. Organizations should upgrade to the latest patched versions of Node.js 20.x and 21.x. Refer to the HackerOne Security Report #2259914 for detailed technical information about the vulnerability disclosure. Additional vendor guidance is available from the NetApp Security Advisory NTAP-20240315-0005 and the Openwall OSS Security Discussion.

Workarounds

  • Avoid using the experimental permission model in production environments until the vulnerability is patched
  • Implement additional input validation at the application layer before paths reach node:fs functions
  • Use containerization or OS-level sandboxing (such as seccomp, AppArmor, or SELinux) as defense-in-depth measures
  • Freeze critical built-in objects using Object.freeze() early in application initialization to prevent modification
bash
# Example: Freezing path module early in application startup
# Add to the very beginning of your application entry point
node --require ./freeze-builtins.js your-app.js

# Contents of freeze-builtins.js:
# Object.freeze(require('path'));
# Object.freeze(Object.getPrototypeOf(require('path')));

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

  • Vulnerability Details
  • TypePath Traversal

  • Vendor/TechNodejs

  • SeverityHIGH

  • CVSS Score8.8

  • EPSS Probability0.17%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-22
  • Technical References
  • Openwall OSS Security Discussion

  • HackerOne Security Report #2259914

  • NetApp Security Advisory NTAP-20240315-0005
  • Related CVEs
  • CVE-2025-23084: Node.js Path Traversal Vulnerability

  • CVE-2023-39332: Node.js Path Traversal Vulnerability

  • CVE-2023-32004: Node.js Path Traversal Vulnerability

  • CVE-2024-21896: Node.js Path Traversal Vulnerability
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