CVE-2021-21707: Special characters break path parsing in XML functions

CVE-2021-21707 affects 21 listed versions of PHP in the Dawnsentry catalogue.

5.3CVSS medium
None knownexploitation
25%EPSS (next 30 days)
29 November 2021published

Affected products and versions

The versions in the Dawnsentry catalogue this CVE affects, judged from the vendor's own advisory where there is one, otherwise from the CVE record and NVD, as each version's own page says.

PHP

21 of 250 listed versions are affected. Fixed in 7.4.26, 7.3.33. The newest release, 8.6.0, is not affected.

7.4.25 7.4.24 7.4.23 7.4.22 7.4.21 7.4.20 7.4.19 7.3.32 7.3.31 7.3.30 7.3.29 7.3.28 7.3.27 7.3.26 7.3.25 7.3.24 7.3.23 7.3.22 7.3.21 7.3.20 7.3.19

What it is

In PHP versions 7.3.x below 7.3.33, 7.4.x below 7.4.26 and 8.0.x below 8.0.13, certain XML parsing functions, like simplexml_load_file(), URL-decode the filename passed to them. If that filename contains URL-encoded NUL character, this may cause the function to interpret this as the end of the filename, thus interpreting the filename differently from what the user intended, which may lead it to reading a different file than intended.

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N (NVD)

Published by Php on 29 November 2021. Last changed 17 June 2026.

Sources

Check one version you run: look CVE-2021-21707 up, or pick a product and version in the quick lookup.

Updated 2 December 2026.