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-2022-0436

CVE-2022-0436: Gruntjs Grunt Path Traversal Vulnerability

CVE-2022-0436 is a path traversal vulnerability in Gruntjs Grunt that allows attackers to access files outside intended directories. This article covers technical details, affected versions prior to 1.5.2, and mitigation.

Published: February 11, 2026

CVE-2022-0436 Overview

CVE-2022-0436 is a Path Traversal vulnerability affecting the Grunt JavaScript task runner prior to version 1.5.2. This vulnerability allows local attackers with low privileges to read arbitrary files outside the intended directory by exploiting improper handling of symbolic links during file copy operations. The flaw exists in Grunt's file handling logic, which failed to properly validate symlinks before processing them.

Critical Impact

Local attackers can leverage this path traversal vulnerability to access sensitive files outside the application's working directory, potentially exposing configuration files, credentials, or other confidential data on the system.

Affected Products

  • gruntjs grunt versions prior to 1.5.2
  • Node.js applications using vulnerable grunt packages
  • Build pipelines and CI/CD systems utilizing affected grunt versions

Discovery Timeline

  • 2022-04-12 - CVE-2022-0436 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2022-0436

Vulnerability Analysis

This vulnerability stems from improper handling of symbolic links in Grunt's file copy functionality. When the file.copy function processes files and directories, it fails to distinguish between regular files/directories and symbolic links. An attacker can craft malicious symbolic links that point to files outside the intended directory structure, allowing unauthorized file access when Grunt processes these symlinks during build operations.

The vulnerability is classified as CWE-22 (Path Traversal), which occurs when software uses external input to construct a pathname that should be within a restricted directory, but fails to properly neutralize elements that can cause the pathname to resolve to a location outside of that directory.

Root Cause

The root cause of this vulnerability lies in the file.copy function in lib/grunt/file.js. The original implementation only checked if the source path was a directory or a regular file using file.isDir(srcpath), without first checking if the path was a symbolic link. This oversight allowed symbolic links pointing to arbitrary locations to be followed and their targets to be copied, effectively bypassing directory restrictions.

Attack Vector

The attack requires local access with low privileges. An attacker can create a malicious symbolic link within a project directory that points to sensitive files outside the intended scope (such as /etc/passwd, SSH keys, or application configuration files). When Grunt's file copy operation processes this directory, it follows the symlink and copies the target file's contents, exposing sensitive data to the attacker.

javascript
// Security patch in lib/grunt/file.js
// Source: https://github.com/gruntjs/grunt/commit/aad3d4521c3098fb255fb2db8f2e1d691a033665

 // Read a file, optionally processing its content, then write the output.
 // Or read a directory, recursively creating directories, reading files,
 // processing content, writing output.
+// Handles symlinks by coping them as files or directories.
 file.copy = function copy(srcpath, destpath, options) {
-  if (file.isDir(srcpath)) {
+  if (file._isSymbolicLink(srcpath)) {
+    file._copySymbolicLink(srcpath, destpath);
+  } else if (file.isDir(srcpath)) {
     // Copy a directory, recursively.
     // Explicitly create new dest directory.
     file.mkdir(destpath);

The patch introduces a new check using file._isSymbolicLink(srcpath) that executes before the directory check. When a symbolic link is detected, it's handled separately via file._copySymbolicLink(), preventing the traversal vulnerability by properly copying the symlink itself rather than following it to its target.

Detection Methods for CVE-2022-0436

Indicators of Compromise

  • Unexpected file read operations targeting system files like /etc/passwd, /etc/shadow, or SSH private keys
  • Presence of symbolic links within project directories pointing to paths outside the project root
  • Build logs showing file operations accessing paths with ../ sequences or absolute paths outside expected directories
  • Unusual grunt task configurations that reference or manipulate symbolic links

Detection Strategies

  • Audit package.json and package-lock.json files for grunt versions prior to 1.5.2
  • Implement Software Composition Analysis (SCA) tools to identify vulnerable dependencies in Node.js projects
  • Monitor file system operations during build processes for access to sensitive system files
  • Review Gruntfile.js configurations for suspicious file copy tasks

Monitoring Recommendations

  • Enable file access auditing on sensitive directories to detect unauthorized read attempts
  • Implement dependency scanning in CI/CD pipelines to catch vulnerable grunt versions before deployment
  • Configure alerting for build processes that access files outside their designated working directories
  • Regularly scan project dependencies using npm audit or equivalent tools

How to Mitigate CVE-2022-0436

Immediate Actions Required

  • Upgrade grunt to version 1.5.2 or later immediately
  • Audit existing projects for any malicious symbolic links in source directories
  • Review build logs for evidence of unauthorized file access
  • Implement the principle of least privilege for build processes

Patch Information

The vulnerability has been fixed in grunt version 1.5.2. The patch modifies the file.copy function to properly detect and handle symbolic links before processing files. The fix is available via the GitHub Commit. Additional security information is available through the Huntr Vulnerability Bounty report and the Debian LTS Security Announcement.

Workarounds

  • If immediate upgrade is not possible, avoid running grunt tasks on untrusted directories or projects
  • Implement pre-build scanning to detect and remove symbolic links from project directories before grunt execution
  • Run grunt processes in isolated containers with restricted file system access
  • Configure file system permissions to prevent the grunt process user from accessing sensitive directories
bash
# Configuration example
# Upgrade grunt to the patched version
npm update grunt@1.5.2

# Verify the installed version
npm list grunt

# Audit for vulnerabilities in your project
npm audit

# Scan for symbolic links in project directory before build
find . -type l -ls

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

  • Vulnerability Details
  • TypePath Traversal

  • Vendor/TechGruntjs

  • SeverityMEDIUM

  • CVSS Score5.5

  • EPSS Probability0.14%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-22
  • Technical References
  • Debian LTS Security Announcement
  • Vendor Resources
  • GitHub Commit Details

  • Huntr Vulnerability Bounty
  • 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