CVE-2021-21706
PHP vulnerability analysis and mitigation

Overview

CVE-2021-21706 is a vulnerability affecting PHP's ZipArchive::extractTo functionality in versions 7.3.x below 7.3.31, 7.4.x below 7.4.24, and 8.0.x below 8.0.11, specifically in Microsoft Windows environments. The vulnerability was discovered in early 2021 and allows attackers to trick the function into writing files outside the intended target directory when extracting ZIP files (PHP Bug, CVE Mitre).

Technical details

The vulnerability stems from an implementation flaw in phpzipmakerelativepath() function, which doesn't properly handle absolute directories on Windows systems. On Windows, a path starting with a slash is treated as a relative path pointing to the current volume rather than an absolute path. This implementation oversight allows for directory traversal outside the intended extraction directory (PHP Bug). The vulnerability has been assigned a CVSS score of 6.5 (Medium) with a vector of CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N (NetApp Advisory).

Impact

When successfully exploited, this vulnerability could lead to unauthorized file creation or modification outside the intended directory structure, subject to operating system permissions. The impact is limited to Windows environments where an attacker could potentially write or overwrite files in unintended locations (CVE Mitre).

Mitigation and workarounds

The vulnerability has been fixed in PHP versions 7.3.31, 7.4.24, and 8.0.11. Users should upgrade to these or later versions to mitigate the risk. The fix involves changes to how ZipArchive::extractTo handles paths with leading slashes on Windows systems (PHP Bug).

Additional resources


SourceThis report was generated using AI

Related PHP vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-65854CRITICAL9.8
  • PHPPHP
  • mineadmin/mineadmin
NoNoDec 12, 2025
CVE-2024-58303HIGH8.6
  • PHPPHP
  • fof/pretty-mail
NoNoDec 11, 2025
CVE-2025-67719HIGH8.5
  • PHPPHP
  • ibexa/user
NoYesDec 11, 2025
CVE-2025-67648HIGH7.1
  • PHPPHP
  • shopware/shopware
NoYesDec 11, 2025
CVE-2025-67737LOW3.1
  • PHPPHP
  • azuracast/azuracast
NoYesDec 12, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management