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

CVE-2021-21706: PHP Path Traversal Vulnerability

CVE-2021-21706 is a path traversal vulnerability in PHP's ZipArchive::extractTo function on Windows that allows attackers to write files outside the target directory. This article covers technical details, affected versions, and mitigation.

Published: February 25, 2026

CVE-2021-21706 Overview

CVE-2021-21706 is a path traversal vulnerability affecting PHP's ZipArchive::extractTo function on Microsoft Windows systems. The vulnerability allows an attacker to craft a malicious ZIP file that, when extracted using the vulnerable PHP function, can write files outside the intended target directory. This could lead to unauthorized file creation or overwriting of existing files, potentially enabling further attacks such as code execution or system compromise.

Critical Impact

Attackers can bypass directory restrictions to create or overwrite files anywhere on the system where PHP has write permissions, potentially leading to web shell deployment or configuration file tampering.

Affected Products

  • PHP versions 7.3.x below 7.3.31
  • PHP versions 7.4.x below 7.4.24
  • PHP versions 8.0.x below 8.0.11
  • Microsoft Windows (as the operating system environment)

Discovery Timeline

  • 2021-10-04 - CVE CVE-2021-21706 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2021-21706

Vulnerability Analysis

This vulnerability is classified under CWE-22 (Improper Limitation of a Pathname to a Restricted Directory, also known as Path Traversal) and CWE-24 (Path Traversal: '../filedir'). The flaw exists specifically in the Windows implementation of PHP's ZipArchive::extractTo method, which fails to properly sanitize file paths contained within ZIP archives before extraction.

When a PHP application uses ZipArchive::extractTo to decompress a ZIP file on Windows, the function does not adequately validate the file paths stored within the archive. An attacker can craft a ZIP file containing entries with path traversal sequences (such as ../ or absolute paths) that escape the intended extraction directory. The vulnerability requires user interaction, as the malicious ZIP file must be processed by a vulnerable PHP application.

The attack is network-accessible, meaning remote attackers can exploit this vulnerability by uploading or providing malicious ZIP files to vulnerable applications. While the vulnerability does not directly impact confidentiality or availability, it poses a significant integrity risk as it enables unauthorized file writes.

Root Cause

The root cause of this vulnerability lies in insufficient path validation within the ZipArchive::extractTo function when handling ZIP entry filenames on Windows systems. The function fails to properly normalize and validate file paths before writing extracted content to the filesystem, allowing specially crafted archive entries to escape the designated extraction directory.

Windows-specific path handling behaviors, including support for alternative path separators and potential encoding issues, contribute to the exploitation surface of this vulnerability.

Attack Vector

The attack requires an attacker to create a malicious ZIP archive containing files with crafted path names designed to escape the target extraction directory. The attack flow is as follows:

  1. Attacker creates a ZIP file with entries containing path traversal sequences (e.g., ../../webroot/shell.php)
  2. Attacker delivers the malicious ZIP file to a vulnerable PHP application (via file upload, URL download, etc.)
  3. The PHP application calls ZipArchive::extractTo to extract the archive contents
  4. Due to improper path validation, files are written outside the intended extraction directory
  5. Attacker gains the ability to create or overwrite files subject to OS permissions

The vulnerability could be chained with other attacks to achieve remote code execution, such as overwriting web-accessible PHP files or configuration files.

Detection Methods for CVE-2021-21706

Indicators of Compromise

  • Unexpected files appearing outside designated upload or extraction directories
  • Web shells or suspicious PHP files in web-accessible locations
  • Modified configuration files with unexpected timestamps
  • Log entries showing ZIP extraction operations followed by anomalous file access patterns

Detection Strategies

  • Monitor PHP application logs for ZipArchive::extractTo operations, particularly those processing user-supplied files
  • Implement file integrity monitoring (FIM) on critical directories to detect unauthorized file creation or modification
  • Deploy web application firewalls (WAF) with rules to inspect uploaded ZIP files for path traversal sequences
  • Review PHP application code for usage of ZipArchive::extractTo without proper input validation

Monitoring Recommendations

  • Enable detailed logging for file system operations on Windows servers running PHP
  • Monitor for creation of new PHP files in web-accessible directories
  • Set up alerts for file modifications outside expected directories during ZIP extraction operations
  • Implement network-level monitoring for large file uploads that may contain malicious ZIP archives

How to Mitigate CVE-2021-21706

Immediate Actions Required

  • Upgrade PHP to version 7.3.31, 7.4.24, or 8.0.11 or later depending on your branch
  • Audit PHP applications for usage of ZipArchive::extractTo and implement additional path validation
  • Restrict file system permissions for the PHP process to minimize impact of potential exploitation
  • Consider disabling ZIP upload functionality temporarily until patches are applied

Patch Information

PHP has released patched versions addressing this vulnerability. Organizations should upgrade to the following minimum versions:

  • PHP 7.3.x: Upgrade to 7.3.31 or later
  • PHP 7.4.x: Upgrade to 7.4.24 or later
  • PHP 8.0.x: Upgrade to 8.0.11 or later

For more information, refer to the PHP Bug Report #81420 and the NetApp Security Advisory NTAP-20211029-0007.

Workarounds

  • Implement application-level path validation before calling ZipArchive::extractTo to reject entries containing path traversal sequences
  • Use a whitelist approach to validate extracted filenames against expected patterns
  • Extract files to an isolated temporary directory with restricted permissions, then move validated files to their final destination
  • Consider using alternative archive handling libraries with built-in path traversal protections
bash
# PHP upgrade example on Debian/Ubuntu systems
sudo apt-get update
sudo apt-get install php7.4=7.4.24-* # Or appropriate version for your installation

# Verify PHP version after upgrade
php -v

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

  • Vulnerability Details
  • TypePath Traversal

  • Vendor/TechPhp

  • SeverityMEDIUM

  • CVSS Score6.5

  • EPSS Probability0.53%

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

  • CWE-22
  • Technical References
  • NetApp Security Advisory NTAP-20211029-0007
  • Vendor Resources
  • PHP Bug Report #81420
  • Related CVEs
  • CVE-2026-22427: GoTravel Path Traversal Vulnerability

  • CVE-2025-69409: PJ Coaching Theme Path Traversal Flaw

  • CVE-2024-8927: PHP Path Traversal Vulnerability

  • CVE-2025-52023: Gems CMS Information Disclosure Vulnerability
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