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
    • 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-2022-0144

CVE-2022-0144: ShellJS Privilege Escalation Vulnerability

CVE-2022-0144 is a privilege escalation vulnerability in ShellJS caused by improper privilege management. Attackers can exploit this flaw to gain elevated access. This article covers technical details, affected versions, and mitigation.

Published: February 17, 2026

CVE-2022-0144 Overview

CVE-2022-0144 is an Improper Privilege Management vulnerability affecting shelljs, a popular Unix shell commands implementation for Node.js. The vulnerability exists in the exec() function which creates temporary files with insecure permissions, potentially allowing unauthorized users to read sensitive command output or interfere with file operations.

Critical Impact

Local attackers with low privileges can exploit insecure file permissions to access sensitive data written to stdout/stderr files or manipulate execution flow by pre-creating locked files.

Affected Products

  • shelljs_project shelljs (Node.js package)

Discovery Timeline

  • 2022-01-11 - CVE CVE-2022-0144 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2022-0144

Vulnerability Analysis

The vulnerability stems from insecure file permission handling in shelljs's synchronous exec() function. When executing commands, shelljs creates temporary files to capture stdout and stderr output. Prior to the security fix, these files were created with default permissions that allowed other users on the system to read their contents.

The attack requires local access with low privileges. Successful exploitation can lead to unauthorized disclosure of sensitive information (confidentiality impact) and denial of service conditions (availability impact) when an attacker pre-creates the target files with restricted permissions.

Root Cause

The root cause is the use of fs.writeFileSync() without specifying restrictive file permissions. The function wrote to paramsFile, stdoutFile, and stderrFile using default system umask settings, which typically allow read access to other users. This violates the principle of least privilege for temporary files that may contain sensitive command output.

The vulnerability is classified under CWE-269 (Improper Privilege Management), as the application fails to properly restrict access to resources that should be protected.

Attack Vector

An attacker with local access to the system can exploit this vulnerability through two primary methods:

  1. Information Disclosure: Monitor or read the stdout/stderr files created by shelljs to capture sensitive command output from other users' processes.

  2. Denial of Service: Read the paramsFile to determine the paths of stdout/stderr files, then pre-create these files with restrictive permissions. This causes the exec() function to crash when it attempts to write to files it cannot access.

The security patch addresses this by implementing a writeFileLockedDown() helper function:

javascript
     stderrFile: stderrFile,
   };
 
-  fs.writeFileSync(paramsFile, JSON.stringify(paramsToSerialize), 'utf8');
+  // Create the files and ensure these are locked down (for read and write) to
+  // the current user. The main concerns here are:
+  //
+  // * If we execute a command which prints sensitive output, then
+  //   stdoutFile/stderrFile must not be readable by other users.
+  // * paramsFile must not be readable by other users, or else they can read it
+  //   to figure out the path for stdoutFile/stderrFile and create these first
+  //   (locked down to their own access), which will crash exec() when it tries
+  //   to write to the files.
+  function writeFileLockedDown(filePath, data) {
+    fs.writeFileSync(filePath, data, {
+      encoding: 'utf8',
+      mode: parseInt('600', 8),
+    });
+  }
+  writeFileLockedDown(stdoutFile, '');
+  writeFileLockedDown(stderrFile, '');
+  writeFileLockedDown(paramsFile, JSON.stringify(paramsToSerialize));
 
   var execArgs = [
     path.join(__dirname, 'exec-child.js'),

Source: GitHub Commit

Detection Methods for CVE-2022-0144

Indicators of Compromise

  • Unusual file access patterns to temporary directories where shelljs creates execution files
  • Multiple read attempts on files matching shelljs temporary file naming patterns
  • Unexpected process crashes in Node.js applications using shelljs exec() function
  • Evidence of file permission manipulation in application log files

Detection Strategies

  • Audit Node.js application dependencies using npm audit or similar tools to identify vulnerable shelljs versions
  • Monitor file system events for temporary files created with overly permissive modes (not 0600)
  • Implement software composition analysis (SCA) scanning in CI/CD pipelines to detect vulnerable packages
  • Use runtime application self-protection (RASP) to monitor for suspicious file operations

Monitoring Recommendations

  • Enable file integrity monitoring on directories commonly used for temporary files
  • Configure alerts for applications using shelljs package versions prior to the security patch
  • Monitor for unusual cross-user file access patterns on multi-user systems
  • Implement dependency scanning as part of regular security assessments

How to Mitigate CVE-2022-0144

Immediate Actions Required

  • Update shelljs to the patched version that includes commit d919d22dd6de385edaa9d90313075a77f74b338c
  • Run npm audit fix to automatically update vulnerable dependencies
  • Review applications using shelljs exec() for potential sensitive data exposure
  • Audit multi-user systems where shelljs applications may have been running

Patch Information

The vulnerability was fixed in the shelljs project through commit d919d22dd6de385edaa9d90313075a77f74b338c. The patch introduces a writeFileLockedDown() helper function that creates all temporary files with mode 0600 (owner read/write only), ensuring that stdout, stderr, and parameter files are protected from access by other users.

For additional details, see the Huntr Bounty Report and the GitHub Commit Update.

Workarounds

  • Avoid using shelljs exec() function in synchronous mode on multi-user systems until patched
  • Implement strict file system permissions on temporary directories used by Node.js applications
  • Consider using the asynchronous exec() mode which may have different behavior
  • Isolate affected applications in containers or sandboxed environments to limit local access
bash
# Update shelljs to patched version
npm update shelljs

# Verify installed version contains the fix
npm list shelljs

# Run security audit
npm audit

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

  • Vulnerability Details
  • TypePrivilege Escalation

  • Vendor/TechShelljs

  • SeverityHIGH

  • CVSS Score7.1

  • EPSS Probability0.18%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-269
  • Vendor Resources
  • GitHub Commit Update

  • Huntr Bounty Report
  • Latest CVEs
  • CVE-2025-52479: HTTP.jl & URIs.jl CRLF Injection Flaw

  • CVE-2026-31740: Linux Kernel Race Condition Vulnerability

  • CVE-2026-31743: Linux Kernel Buffer Overflow Vulnerability

  • CVE-2026-31744: Linux Kernel NULL Pointer 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