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-41072

CVE-2021-41072: Squashfs-Tools Path Traversal Vulnerability

CVE-2021-41072 is a path traversal flaw in Squashfs-Tools 4.5 that exploits symbolic links to write files outside intended directories. This article covers the technical details, affected versions, and mitigation.

Published: March 4, 2026

CVE-2021-41072 Overview

CVE-2021-41072 is a Directory Traversal vulnerability in the squashfs_opendir function within unsquash-2.c in Squashfs-Tools version 4.5. This vulnerability allows an attacker to craft a malicious squashfs filesystem containing a symbolic link followed by contents under the same filename, enabling unsquashfs to write files outside the expected destination directory. This is a distinct vulnerability from CVE-2021-40153, which also affected Squashfs-Tools.

Critical Impact

Attackers can exploit this flaw to write arbitrary files anywhere on the filesystem by creating symbolic links pointing outside the extraction directory, potentially leading to arbitrary code execution or system compromise.

Affected Products

  • Squashfs-Tools 4.5
  • Debian Linux 9.0, 10.0, 11.0
  • Linux distributions shipping vulnerable Squashfs-Tools versions

Discovery Timeline

  • 2021-09-14 - CVE-2021-41072 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2021-41072

Vulnerability Analysis

The vulnerability resides in the squashfs_opendir function in unsquash-2.c, which fails to properly validate directory entries during squashfs extraction. The root cause is a lack of duplicate name checking within directories, combined with improper handling of symbolic links during the extraction sequence.

When processing a crafted squashfs filesystem, the extraction process first creates a symbolic link pointing to an attacker-controlled location outside the intended destination directory. Subsequently, when the extractor encounters another entry with the same filename, it follows the previously created symbolic link and writes content to the arbitrary location specified by the attacker.

This vulnerability can be exploited remotely if a user extracts a malicious squashfs archive obtained from an untrusted source, though user interaction is required to trigger the extraction.

Root Cause

The fundamental issue stems from missing directory integrity checks in the squashfs extraction code. The squashfs_opendir function does not verify that directory entries have unique names before processing them. This oversight allows an attacker to include duplicate filenames in a squashfs archive—first as a symbolic link, then as regular content—causing the extraction tool to write through the symlink to arbitrary filesystem locations.

Attack Vector

An attacker can exploit this vulnerability by crafting a malicious squashfs filesystem image containing:

  1. A symbolic link entry pointing to a target location outside the extraction directory (e.g., /etc/cron.d/malicious)
  2. A subsequent file entry with the same filename containing malicious content

When unsquashfs processes this archive, it creates the symbolic link first, then attempts to write the file content to the same path, inadvertently following the symlink and writing to the attacker-specified location.

c
// Security patch in squashfs-tools/unsquash-1.c
// Adds directory sorting and duplicate name detection to prevent exploitation
// Source: https://github.com/plougher/squashfs-tools/commit/e0485802ec72996c20026da320650d8362f555bd

 		}
 	}
 
+	/* check directory for duplicate names.  Need to sort directory first */
+	sort_directory(dir);
+	if(check_directory(dir) == FALSE) {
+		ERROR("File system corrupted: directory has duplicate names\n");
+		goto corrupted;
+	}
 	return dir;
 
 corrupted:

Source: GitHub Commit Update

Detection Methods for CVE-2021-41072

Indicators of Compromise

  • Unexpected symbolic links created during squashfs extraction pointing outside the destination directory
  • Unauthorized file modifications in sensitive directories such as /etc, /root, or system binary paths
  • Suspicious squashfs archives containing duplicate filename entries with different file types
  • Log entries indicating squashfs extraction operations followed by unexpected file system changes

Detection Strategies

  • Monitor file system operations during squashfs extraction for symbolic link creation followed by file writes to the same path
  • Implement integrity monitoring on critical system directories to detect unauthorized modifications
  • Scan squashfs archives for duplicate directory entries before extraction using file analysis tools
  • Deploy endpoint detection rules to identify unsquashfs processes writing to locations outside expected extraction directories

Monitoring Recommendations

  • Enable audit logging for all squashfs extraction operations in production environments
  • Configure file integrity monitoring (FIM) on critical system paths to alert on unexpected modifications
  • Implement sandbox environments for extracting untrusted squashfs archives
  • Monitor process execution chains involving unsquashfs for anomalous file system write patterns

How to Mitigate CVE-2021-41072

Immediate Actions Required

  • Update Squashfs-Tools to a patched version immediately on all affected systems
  • Avoid extracting squashfs archives from untrusted or unverified sources
  • Implement extraction in isolated environments or containers when processing external archives
  • Review recently extracted squashfs archives for potential compromise indicators

Patch Information

The Squashfs-Tools maintainers have released a fix that adds directory sorting and duplicate name checking to prevent this exploitation technique. The patch introduces a check_directory() function that detects and rejects filesystem images containing duplicate names, treating them as corrupted.

The fix is available via the GitHub commit e0485802. Distribution-specific patches are available through:

  • Debian Security Advisory DSA-4987
  • Debian LTS Announcement
  • Gentoo GLSA 2023-29

Workarounds

  • Extract squashfs archives only in isolated sandbox environments or containers with restricted filesystem access
  • Implement a pre-extraction validation script that scans squashfs archives for duplicate directory entries
  • Use restricted user permissions when running unsquashfs to limit potential write locations
  • Configure mandatory access controls (SELinux/AppArmor) to confine unsquashfs file write operations
bash
# Configuration example - Extract squashfs in restricted environment
# Create a sandboxed extraction using unshare and chroot

# Create isolated extraction directory with restricted permissions
mkdir -p /tmp/squashfs-sandbox
chmod 700 /tmp/squashfs-sandbox

# Extract with restricted filesystem namespace (Linux)
unshare --mount --map-root-user bash -c "
    mount --bind /tmp/squashfs-sandbox /tmp/squashfs-sandbox
    mount --make-private /tmp/squashfs-sandbox
    cd /tmp/squashfs-sandbox
    unsquashfs -d ./extracted /path/to/archive.squashfs
"

# Alternative: Use firejail for sandboxed extraction
firejail --private=/tmp/squashfs-sandbox unsquashfs -d ./extracted /path/to/archive.squashfs

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

  • Vulnerability Details
  • TypePath Traversal

  • Vendor/TechSquashfs

  • SeverityHIGH

  • CVSS Score8.1

  • EPSS Probability3.58%

  • 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
  • Technical References
  • GitHub Issue Comment

  • Debian LTS Announcement

  • Gentoo GLSA Advisory 2023-29

  • Debian Security Advisory DSA-4987
  • Vendor Resources
  • GitHub Commit Update
  • 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