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-2021-32803

CVE-2021-32803: Tar (node-tar) Path Traversal Vulnerability

CVE-2021-32803 is a path traversal vulnerability in the npm package tar (node-tar) that allows arbitrary file creation via symlink bypass. This article covers technical details, affected versions, impact, and mitigation.

Published: February 25, 2026

CVE-2021-32803 Overview

CVE-2021-32803 is a symlink attack vulnerability in the npm package tar (aka node-tar) that allows arbitrary file creation and overwrite through insufficient symlink protection. The vulnerability exists in versions prior to 6.1.2, 5.0.7, 4.4.15, and 3.2.3. An attacker can craft a malicious tar archive that bypasses the library's symlink security checks, enabling them to write files to arbitrary locations on the filesystem.

The node-tar library is designed to prevent file extraction to locations that would be modified by symbolic links. However, a race condition in the directory caching mechanism allows attackers to first create a directory, then replace it with a symlink, effectively bypassing all symlink validation checks. This enables untrusted tar files to escape their intended extraction directory and write arbitrary content anywhere the process has write access.

Critical Impact

Attackers can achieve arbitrary file creation and overwrite on systems processing untrusted tar archives, potentially leading to code execution, configuration tampering, or denial of service.

Affected Products

  • Tar Project node-tar (versions before 6.1.2, 5.0.7, 4.4.15, and 3.2.3)
  • Oracle GraalVM Enterprise Edition (versions 20.3.3 and 21.2.0)
  • Siemens SINEC Infrastructure Network Services

Discovery Timeline

  • 2021-08-03 - CVE-2021-32803 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2021-32803

Vulnerability Analysis

This vulnerability exploits a flaw in the directory caching logic of node-tar. The library maintains a directory cache to optimize extraction performance by avoiding redundant filesystem stat calls. When a directory is created during extraction, its path is added to this cache, and subsequent operations on that path skip the directory creation step—including the critical symlink validation checks.

The attack works by crafting a tar archive with a specific ordering of entries: first, a legitimate directory entry is included, which gets created and cached. Then, a symlink entry with the same name as the directory is included, which replaces the directory. Because the path is already in the directory cache, subsequent file extractions targeting paths under that directory bypass the symlink checks entirely, allowing the symlink to redirect writes to arbitrary filesystem locations.

This is a classic Time-of-Check Time-of-Use (TOCTOU) vulnerability combined with a cache poisoning technique. The security check happens when the directory is first created, but by the time files are extracted, the directory has been replaced with a malicious symlink.

Root Cause

The root cause is insufficient cache invalidation in the node-tar extraction logic. When a non-directory entry (such as a symlink) is about to be extracted to a path that exists in the directory cache, the library fails to invalidate that cache entry. This allows the symlink to be created in place of the cached directory, while the cache still indicates that path is a safe directory.

The vulnerable code path occurs in the CHECKFS2 function within lib/unpack.js, where the library checks filesystem state before extraction but trusts the directory cache without verifying that cached directories still exist as directories.

Attack Vector

The attack is network-based, requiring user interaction to process a malicious tar archive. An attacker must convince a victim to extract a specially crafted tar file using an application that depends on a vulnerable version of node-tar. Common attack scenarios include:

  1. Supply chain attacks through malicious npm packages containing crafted tar files
  2. Web applications that accept user-uploaded archives
  3. Build systems processing third-party dependencies
  4. Automated deployment pipelines extracting external artifacts
javascript
   }
 
   [CHECKFS2] (entry, done) {
+    // if we are not creating a directory, and the path is in the dirCache,
+    // then that means we are about to delete the directory we created
+    // previously, and it is no longer going to be a directory, and neither
+    // is any of its children.
+    if (entry.type !== 'Directory') {
+      for (const path of this.dirCache.keys()) {
+        if (path === entry.absolute ||
+            path.indexOf(entry.absolute + '/') === 0 ||
+            path.indexOf(entry.absolute + '\\') === 0)
+          this.dirCache.delete(path)
+      }
+    }
+
     this[MKDIR](path.dirname(entry.absolute), this.dmode, er => {
       if (er) {
         done()

Source: GitHub Commit for Node Tar

Detection Methods for CVE-2021-32803

Indicators of Compromise

  • Unexpected symlinks appearing in extraction directories pointing outside the intended path
  • File modifications in system directories or sensitive locations after tar extraction operations
  • Application logs showing extraction of tar entries with identical directory and symlink names

Detection Strategies

  • Audit npm dependency trees using npm audit or yarn audit to identify vulnerable node-tar versions
  • Implement Software Composition Analysis (SCA) scanning in CI/CD pipelines to detect vulnerable dependencies
  • Monitor file system operations during tar extraction for symlink creation followed by file writes through that symlink
  • Review extracted tar contents for suspicious entry ordering (directory followed by same-named symlink)

Monitoring Recommendations

  • Enable file integrity monitoring on critical system directories to detect unauthorized modifications
  • Log and alert on tar extraction operations that create symlinks pointing outside the extraction root
  • Implement runtime application self-protection (RASP) to monitor file operations in Node.js applications

How to Mitigate CVE-2021-32803

Immediate Actions Required

  • Update node-tar to version 6.1.2, 5.0.7, 4.4.15, or 3.2.3 or later depending on your major version
  • Run npm audit fix or yarn upgrade to automatically update vulnerable dependencies
  • Review applications for any code paths that process untrusted tar archives
  • For Oracle GraalVM users, apply the Oracle Critical Patch Update - October 2021
  • For Siemens SINEC INS users, review Siemens Security Advisory SSA-389290

Patch Information

The vulnerability has been patched in node-tar versions 3.2.3, 4.4.15, 5.0.7, and 6.1.2. The fix ensures that when a non-directory entry is about to be extracted, any matching paths in the directory cache are invalidated. This prevents the cache from being poisoned when a directory is replaced with a symlink. Detailed patch information is available in the GitHub Security Advisory GHSA-r628-mhmh-qjhw and npm Advisory #1771.

Workarounds

  • Avoid extracting tar files from untrusted sources until the patch can be applied
  • Use the --no-same-owner and --no-same-permissions flags if using command-line tar as an alternative
  • Implement a pre-extraction validation step to reject tar files containing both directories and symlinks with identical names
  • Run tar extraction operations in isolated containers or sandboxes with restricted filesystem access
bash
# Update node-tar to patched version
npm update tar

# Verify installed version
npm list tar

# Run security audit to detect other vulnerable packages
npm audit

# Force update to specific patched version if needed
npm install tar@6.1.2

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

  • Vulnerability Details
  • TypePath Traversal

  • Vendor/TechTar Project

  • SeverityHIGH

  • CVSS Score8.1

  • EPSS Probability0.15%

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

  • CWE-59
  • Technical References
  • npm Package: Tar
  • Vendor Resources
  • Siemens Security Advisory SSA-389290

  • GitHub Commit for Node Tar

  • GitHub Security Advisory GHSA-r628-mhmh-qjhw

  • npm Advisory #1771

  • Oracle Critical Patch Update - October 2021
  • Latest CVEs
  • CVE-2025-70797: LimeSurvey XSS Vulnerability

  • CVE-2025-30650: Juniper Junos OS Auth Bypass Vulnerability

  • CVE-2026-35471: Goshs Path Traversal Vulnerability

  • CVE-2026-35393: Goshs 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