A Leader in the 2026 Gartner® Magic Quadrant™ for Endpoint Protection. Six years running.Six years. Gartner® Magic Quadrant™ Leader.Find Out Why
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-2024-12905

CVE-2024-12905: tar-fs Path Traversal Vulnerability

CVE-2024-12905 is a path traversal vulnerability in the tar-fs package that allows unauthorized file writes outside extraction directories when processing malicious tar files. This article covers technical details, affected versions, and mitigation.

Published: May 26, 2026

CVE-2024-12905 Overview

CVE-2024-12905 affects the tar-fs Node.js package, a widely used module for streaming files into and out of tar archives. The vulnerability combines improper link resolution before file access (link following) and path traversal [CWE-22]. When tar-fs extracts a maliciously crafted tar archive, attackers can write or overwrite files outside the intended extraction directory. The flaw resides in index.js and impacts versions prior to 1.16.4, 2.1.2, and 3.0.8.

Critical Impact

A network attacker who supplies a crafted tar archive can write arbitrary files outside the target directory, leading to integrity compromise of the host filesystem and potential code execution through overwriting trusted files.

Affected Products

  • tar-fs versions 0.0.0 through 1.16.3
  • tar-fs versions 2.0.0 through 2.1.1
  • tar-fs versions 3.0.0 through 3.0.7

Discovery Timeline

  • 2025-03-27 - CVE-2024-12905 published to NVD
  • 2026-04-15 - Last updated in NVD database

Technical Details for CVE-2024-12905

Vulnerability Analysis

The tar-fs package extracts tar archives by iterating over archive entries and writing each entry to a target directory specified by the caller. The extraction routine in index.js failed to canonicalize the working directory and did not sufficiently validate symbolic link targets contained in archive entries.

An attacker who controls the archive content can include entries whose names contain .. sequences or whose link targets point outside the extraction root. During extraction, the library follows those links or resolves the relative paths against an unresolved base, causing file writes to escape the intended sandbox. This places the issue in the path traversal and link following class of vulnerabilities tracked under [CWE-22].

The exploit prediction score (EPSS) places this CVE in roughly the 74th percentile, indicating meaningful real-world exploitation likelihood. A working proof of concept is referenced in public exploit databases.

Root Cause

The extraction function accepted a caller-supplied cwd argument without resolving it to an absolute, canonical path before joining it with entry names from the archive. Combined with insufficient validation of symlink entries, this allowed crafted entries to resolve to filesystem locations outside cwd. See the Seal Security analysis for a detailed walkthrough.

Attack Vector

The attack vector is network-reachable in any context where tar-fs extracts archives originating from untrusted sources, including package installers, container build tooling, CI/CD artifact handlers, and file upload pipelines. The attacker supplies a tar archive containing either traversal sequences in entry names or symlink entries pointing to sensitive paths such as ~/.ssh/authorized_keys or system binaries.

javascript
// Patch from index.js - resolve cwd before extraction
// Source: https://github.com/mafintosh/tar-fs/commit/a1dd7e7c7f4b4a8bd2ab60f513baca573b44e2ed

   if (!cwd) cwd = '.'
   if (!opts) opts = {}
 
+  cwd = path.resolve(cwd)
+
   const xfs = opts.fs || fs
   const ignore = opts.ignore || opts.filter || noop
   const mapStream = opts.mapStream || echo

The patch resolves cwd to an absolute path so subsequent containment checks operate on a stable base. The fix also refactors symlink handling to throw when an entry targets a path outside the extraction root.

Detection Methods for CVE-2024-12905

Indicators of Compromise

  • Unexpected files written outside known extraction directories shortly after a Node.js process invokes tar-fs.
  • Modification of sensitive files such as ~/.ssh/authorized_keys, ~/.npmrc, or systemd unit files by Node.js processes.
  • Tar archives containing entries with ../ sequences in their names or symlink entries whose linkname points to absolute paths.

Detection Strategies

  • Inventory Node.js applications and container images for vulnerable versions of tar-fs using software composition analysis (SCA) against package-lock.json and yarn.lock.
  • Inspect tar archives received from untrusted sources with a parser that flags entries containing .. segments or symlinks pointing outside the archive root.
  • Correlate process telemetry to identify node processes writing to filesystem paths outside the working directory of the extraction call.

Monitoring Recommendations

  • Enable filesystem auditing on sensitive directories such as /etc, user home directories, and CI workspace roots.
  • Log and review tar extraction operations in build pipelines, capturing source archive hashes and extraction targets.
  • Alert on writes to authentication-related files by interpreter processes that do not normally touch them.

How to Mitigate CVE-2024-12905

Immediate Actions Required

  • Upgrade tar-fs to 1.16.4, 2.1.2, or 3.0.8 or later depending on the major version in use.
  • Audit transitive dependencies, because tar-fs is frequently pulled in indirectly by container tooling and package managers.
  • Treat any tar archive from an untrusted source as hostile until extraction occurs inside a sandboxed directory on a patched version.

Patch Information

The upstream fix is committed in mafintosh/tar-fs commit a1dd7e7 and shipped in versions 1.16.4, 2.1.2, and 3.0.8. Debian users should apply updates announced in the Debian LTS advisory.

Workarounds

  • Validate every archive entry name and linkname against an allowlist before invoking extraction, rejecting any entry containing .. or absolute paths.
  • Extract archives inside an ephemeral chroot or container with no write access to host paths.
  • Disable symlink creation during extraction by passing a custom fs implementation that throws on symlink calls.
bash
# Pin a fixed version across npm projects
npm install tar-fs@^3.0.8

# Verify the resolved version in a lockfile
npm ls tar-fs

# For Debian-based systems, apply the LTS update
sudo apt update && sudo apt install --only-upgrade node-tar-fs

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 Fs

  • SeverityHIGH

  • CVSS Score7.5

  • EPSS Probability0.81%

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

  • Seal Security Blog Post

  • Debian LTS Announcement
  • Related CVEs
  • CVE-2025-48387: tar-fs Path Traversal Vulnerability

  • CVE-2025-59343: tar-fs Path Traversal Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today 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