CVE-2021-21707
PHP vulnerability analysis and mitigation

Overview

CVE-2021-21707 affects PHP versions 7.3.x below 7.3.33, 7.4.x below 7.4.26, and 8.0.x below 8.0.13. The vulnerability involves certain XML parsing functions, like simplexml_load_file(), which URL-decode the filename passed to them. When the filename contains a URL-encoded NUL character, the function may interpret this as the end of the filename, potentially leading to reading a different file than intended (CVE Mitre).

Technical details

The vulnerability occurs when XML parsing functions process filenames containing URL-encoded NUL characters (%00). The functions decode these characters, causing them to interpret the NUL byte as a string terminator. This behavior can cause the function to read only the portion of the filename before the NUL character, potentially leading to unintended file access (PHP Bug).

Impact

The successful exploitation of this vulnerability could lead to disclosure of sensitive information. The vulnerability has been assigned a CVSS score of 5.3 (MEDIUM) with the vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N (NetApp Advisory).

Exploitability

The vulnerability can be exploited by combining directory traversal techniques with null character injection. An attacker could potentially craft a filename that includes '../../etc/passwd%00file' to access unintended files on the server (PHP Bug).

Mitigation and workarounds

The vulnerability has been fixed in PHP versions 7.3.33, 7.4.26, and 8.0.13 and later. Users should upgrade to these or newer versions to address the issue. The fix involves implementing checks for URL-encoded NUL characters in filenames before processing them (Red Hat Advisory).

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

GHSA-wg23-69c2-gjc8CRITICAL9.1
  • PHP logoPHP
  • craftcms/cms
NoYesAug 07, 2026
CVE-2026-71488HIGH7.5
  • PHP logoPHP
  • markdown
NoYesAug 06, 2026
CVE-2026-62996MEDIUM6.9
  • PHP logoPHP
  • smarty/smarty
NoYesAug 07, 2026
CVE-2026-62992MEDIUM6.9
  • PHP logoPHP
  • smarty/smarty
NoYesAug 07, 2026
CVE-2026-71478MEDIUM6.1
  • PHP logoPHP
  • commonmark
NoYesAug 06, 2026

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