CVEfocus › CVE database › CVE-2021-21707

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

CVSS 5.3 MediumEPSS 25.3% (higher than 98% of CVEs)Published 2021-11-29Updated 2024-09-17Assigner: php

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.

CWE-159

What to do

Likely to be exploited: EPSS gives a 25% chance of exploitation in the next 30 days. Treat it as urgent if you run an affected version.

Fixed builds are available from AlmaLinux, Alpine, Red Hat, Rocky Linux, Ubuntu: see the table below for the fixed version per release.

Ubuntu has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

95Fixed
2Fix pending
54Will not fix
26Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 22.04php8.1Not affected
vulnerable_code_not_present
Ubuntu 20.04php7.4Fixed7.4.3-4ubuntu2.10UBUNTU-CVE-2021-21707
Ubuntu 18.04php7.2Fixed7.2.24-0ubuntu0.18.04.11UBUNTU-CVE-2021-21707
Ubuntu 16.04php7.0Fix pending7.0.33-0ubuntu0.16.04.16+esm3 (Ubuntu Pro)UBUNTU-CVE-2021-21707
Ubuntu 14.04php5Fix pendingUBUNTU-CVE-2021-21707
Red Hat Enterprise Linux 9phpNot affected
Red Hat Enterprise Linux 9php-bcmathNot affected
Red Hat Enterprise Linux 9php-cliNot affected
Red Hat Enterprise Linux 9php-commonNot affected
Red Hat Enterprise Linux 9php-dbaNot affected
Red Hat Enterprise Linux 9php-dbgNot affected
Red Hat Enterprise Linux 9php-develNot affected
Red Hat Enterprise Linux 9php-embeddedNot affected
Red Hat Enterprise Linux 9php-enchantNot affected
Red Hat Enterprise Linux 9php-ffiNot affected
Red Hat Enterprise Linux 9php-fpmNot affected
Red Hat Enterprise Linux 9php-gdNot affected
Red Hat Enterprise Linux 9php-gmpNot affected
Red Hat Enterprise Linux 9php-intlNot affected
Red Hat Enterprise Linux 9php-ldapNot affected
Red Hat Enterprise Linux 9php-mbstringNot affected
Red Hat Enterprise Linux 9php-mysqlndNot affected
Red Hat Enterprise Linux 9php-odbcNot affected
Red Hat Enterprise Linux 9php-opcacheNot affected
Red Hat Enterprise Linux 9php-pdoNot affected
Red Hat Enterprise Linux 9php-pgsqlNot affected
Red Hat Enterprise Linux 9php-processNot affected
Red Hat Enterprise Linux 9php-snmpNot affected
Red Hat Enterprise Linux 9php-soapNot affected
Red Hat Enterprise Linux 9php-xmlNot affected
Red Hat Enterprise Linux 8apcu-panelFixed
Out of support scope
0:5.1.18-1.module+el8.3.0+6678+b09f589eRHSA-2022:7628
Red Hat Enterprise Linux 8libzipFixed
Out of support scope
0:1.6.1-1.module+el8.3.0+6678+b09f589eRHSA-2022:7628
Red Hat Enterprise Linux 8libzip-develFixed
Out of support scope
0:1.6.1-1.module+el8.3.0+6678+b09f589eRHSA-2022:7628
Red Hat Enterprise Linux 8libzip-toolsFixed
Out of support scope
0:1.6.1-1.module+el8.3.0+6678+b09f589eRHSA-2022:7628
Red Hat Enterprise Linux 8phpFixed
Out of support scope
0:7.4.30-1.module+el8.7.0+15886+8e29b882RHSA-2022:7628
Red Hat Enterprise Linux 8php-bcmathFixed
Out of support scope
0:7.4.30-1.module+el8.7.0+15886+8e29b882RHSA-2022:7628
Red Hat Enterprise Linux 8php-cliFixed
Out of support scope
0:7.4.30-1.module+el8.7.0+15886+8e29b882RHSA-2022:7628
Red Hat Enterprise Linux 8php-commonFixed
Out of support scope
0:7.4.30-1.module+el8.7.0+15886+8e29b882RHSA-2022:7628
Red Hat Enterprise Linux 8php-dbaFixed
Out of support scope
0:7.4.30-1.module+el8.7.0+15886+8e29b882RHSA-2022:7628
Red Hat Enterprise Linux 8php-dbgFixed
Out of support scope
0:7.4.30-1.module+el8.7.0+15886+8e29b882RHSA-2022:7628
Red Hat Enterprise Linux 8php-develFixed
Out of support scope
0:7.4.30-1.module+el8.7.0+15886+8e29b882RHSA-2022:7628
Red Hat Enterprise Linux 8php-embeddedFixed
Out of support scope
0:7.4.30-1.module+el8.7.0+15886+8e29b882RHSA-2022:7628
Red Hat Enterprise Linux 8php-enchantFixed
Out of support scope
0:7.4.30-1.module+el8.7.0+15886+8e29b882RHSA-2022:7628
Red Hat Enterprise Linux 8php-ffiFixed
Out of support scope
0:7.4.30-1.module+el8.7.0+15886+8e29b882RHSA-2022:7628
Red Hat Enterprise Linux 8php-fpmFixed
Out of support scope
0:7.4.30-1.module+el8.7.0+15886+8e29b882RHSA-2022:7628
Red Hat Enterprise Linux 8php-gdFixed
Out of support scope
0:7.4.30-1.module+el8.7.0+15886+8e29b882RHSA-2022:7628
Red Hat Enterprise Linux 8php-gmpFixed
Out of support scope
0:7.4.30-1.module+el8.7.0+15886+8e29b882RHSA-2022:7628
Red Hat Enterprise Linux 8php-intlFixed
Out of support scope
0:7.4.30-1.module+el8.7.0+15886+8e29b882RHSA-2022:7628
Red Hat Enterprise Linux 8php-jsonFixed
Out of support scope
0:7.4.30-1.module+el8.7.0+15886+8e29b882RHSA-2022:7628
Red Hat Enterprise Linux 8php-ldapFixed
Out of support scope
0:7.4.30-1.module+el8.7.0+15886+8e29b882RHSA-2022:7628
Red Hat Enterprise Linux 8php-mbstringFixed
Out of support scope
0:7.4.30-1.module+el8.7.0+15886+8e29b882RHSA-2022:7628
Red Hat Enterprise Linux 8php-mysqlndFixed
Out of support scope
0:7.4.30-1.module+el8.7.0+15886+8e29b882RHSA-2022:7628
Red Hat Enterprise Linux 8php-odbcFixed
Out of support scope
0:7.4.30-1.module+el8.7.0+15886+8e29b882RHSA-2022:7628
Red Hat Enterprise Linux 8php-opcacheFixed
Out of support scope
0:7.4.30-1.module+el8.7.0+15886+8e29b882RHSA-2022:7628
Red Hat Enterprise Linux 8php-pdoFixed
Out of support scope
0:7.4.30-1.module+el8.7.0+15886+8e29b882RHSA-2022:7628
Red Hat Enterprise Linux 8php-pearFixed
Out of support scope
1:1.10.13-1.module+el8.7.0+15127+a450a8dbRHSA-2022:7628
Red Hat Enterprise Linux 8php-pecl-apcuFixed
Out of support scope
0:5.1.18-1.module+el8.3.0+6678+b09f589eRHSA-2022:7628
Red Hat Enterprise Linux 8php-pecl-apcu-develFixed
Out of support scope
0:5.1.18-1.module+el8.3.0+6678+b09f589eRHSA-2022:7628
Red Hat Enterprise Linux 8php-pecl-rrdFixed
Out of support scope
0:2.0.1-1.module+el8.3.0+6678+b09f589eRHSA-2022:7628
Red Hat Enterprise Linux 8php-pecl-xdebugFixed
Out of support scope
0:2.9.5-1.module+el8.3.0+6678+b09f589eRHSA-2022:7628
Red Hat Enterprise Linux 8php-pecl-xdebug3Will not fix
Out of support scope
Red Hat Enterprise Linux 8php-pecl-zipFixed
Out of support scope
0:1.18.2-1.module+el8.3.0+6678+b09f589eRHSA-2022:7628
Red Hat Enterprise Linux 8php-pgsqlFixed
Out of support scope
0:7.4.30-1.module+el8.7.0+15886+8e29b882RHSA-2022:7628
Red Hat Enterprise Linux 8php-processFixed
Out of support scope
0:7.4.30-1.module+el8.7.0+15886+8e29b882RHSA-2022:7628
Red Hat Enterprise Linux 8php-recodeWill not fix
Out of support scope
Red Hat Enterprise Linux 8php-snmpFixed
Out of support scope
0:7.4.30-1.module+el8.7.0+15886+8e29b882RHSA-2022:7628
Red Hat Enterprise Linux 8php-soapFixed
Out of support scope
0:7.4.30-1.module+el8.7.0+15886+8e29b882RHSA-2022:7628
Red Hat Enterprise Linux 8php-xmlFixed
Out of support scope
0:7.4.30-1.module+el8.7.0+15886+8e29b882RHSA-2022:7628
Red Hat Enterprise Linux 8php-xmlrpcFixed
Out of support scope
0:7.4.30-1.module+el8.7.0+15886+8e29b882RHSA-2022:7628
Red Hat Enterprise Linux 7phpWill not fix
Out of support scope
Red Hat Enterprise Linux 7php-bcmathWill not fix
Out of support scope
Red Hat Enterprise Linux 7php-cliWill not fix
Out of support scope
Red Hat Enterprise Linux 7php-commonWill not fix
Out of support scope
Red Hat Enterprise Linux 7php-dbaWill not fix
Out of support scope
Red Hat Enterprise Linux 7php-develWill not fix
Out of support scope
Red Hat Enterprise Linux 7php-embeddedWill not fix
Out of support scope
Red Hat Enterprise Linux 7php-enchantWill not fix
Out of support scope
Red Hat Enterprise Linux 7php-fpmWill not fix
Out of support scope
Red Hat Enterprise Linux 7php-gdWill not fix
Out of support scope
Red Hat Enterprise Linux 7php-intlWill not fix
Out of support scope
Red Hat Enterprise Linux 7php-ldapWill not fix
Out of support scope
Red Hat Enterprise Linux 7php-mbstringWill not fix
Out of support scope
Red Hat Enterprise Linux 7php-mysqlWill not fix
Out of support scope
Red Hat Enterprise Linux 7php-mysqlndWill not fix
Out of support scope
Red Hat Enterprise Linux 7php-odbcWill not fix
Out of support scope
Red Hat Enterprise Linux 7php-pdoWill not fix
Out of support scope
Red Hat Enterprise Linux 7php-pgsqlWill not fix
Out of support scope
Red Hat Enterprise Linux 7php-processWill not fix
Out of support scope
Red Hat Enterprise Linux 7php-pspellWill not fix
Out of support scope
Red Hat Enterprise Linux 7php-recodeWill not fix
Out of support scope
Red Hat Enterprise Linux 7php-snmpWill not fix
Out of support scope
Red Hat Enterprise Linux 7php-soapWill not fix
Out of support scope
Red Hat Enterprise Linux 7php-xmlWill not fix
Out of support scope
Red Hat Enterprise Linux 7php-xmlrpcWill not fix
Out of support scope
Red Hat Enterprise Linux 6phpWill not fix
Out of support scope
Red Hat Enterprise Linux 6php-bcmathWill not fix
Out of support scope
Red Hat Enterprise Linux 6php-cliWill not fix
Out of support scope
Red Hat Enterprise Linux 6php-commonWill not fix
Out of support scope
Red Hat Enterprise Linux 6php-dbaWill not fix
Out of support scope
Red Hat Enterprise Linux 6php-develWill not fix
Out of support scope
Red Hat Enterprise Linux 6php-embeddedWill not fix
Out of support scope
Red Hat Enterprise Linux 6php-enchantWill not fix
Out of support scope
Red Hat Enterprise Linux 6php-fpmWill not fix
Out of support scope
Red Hat Enterprise Linux 6php-gdWill not fix
Out of support scope
Red Hat Enterprise Linux 6php-imapWill not fix
Out of support scope
Red Hat Enterprise Linux 6php-intlWill not fix
Out of support scope
Red Hat Enterprise Linux 6php-ldapWill not fix
Out of support scope
Red Hat Enterprise Linux 6php-mbstringWill not fix
Out of support scope
Red Hat Enterprise Linux 6php-mysqlWill not fix
Out of support scope
Red Hat Enterprise Linux 6php-odbcWill not fix
Out of support scope
Red Hat Enterprise Linux 6php-pdoWill not fix
Out of support scope
Red Hat Enterprise Linux 6php-pgsqlWill not fix
Out of support scope
Red Hat Enterprise Linux 6php-processWill not fix
Out of support scope
Red Hat Enterprise Linux 6php-pspellWill not fix
Out of support scope
Red Hat Enterprise Linux 6php-recodeWill not fix
Out of support scope
Red Hat Enterprise Linux 6php-snmpWill not fix
Out of support scope
Red Hat Enterprise Linux 6php-soapWill not fix
Out of support scope
Red Hat Enterprise Linux 6php-tidyWill not fix
Out of support scope
Red Hat Enterprise Linux 6php-xmlWill not fix
Out of support scope
Red Hat Enterprise Linux 6php-xmlrpcWill not fix
Out of support scope
Red Hat Enterprise Linux 6php-ztsWill not fix
Out of support scope
AlmaLinux 8apcu-panelFixed5.1.18-1.module_el8.6.0+2750+78feabcbALSA-2022:7628
AlmaLinux 8libzipFixed1.6.1-1.module_el8.6.0+3239+bedf0508ALSA-2022:7628
AlmaLinux 8libzip-develFixed1.6.1-1.module_el8.6.0+3239+bedf0508ALSA-2022:7628
AlmaLinux 8libzip-toolsFixed1.6.1-1.module_el8.6.0+2750+78feabcbALSA-2022:7628
AlmaLinux 8phpFixed7.4.30-1.module_el8.7.0+3286+227f3cf0ALSA-2022:7628
AlmaLinux 8php-bcmathFixed7.4.30-1.module_el8.7.0+3286+227f3cf0ALSA-2022:7628
AlmaLinux 8php-cliFixed7.4.30-1.module_el8.7.0+3286+227f3cf0ALSA-2022:7628
AlmaLinux 8php-commonFixed7.4.30-1.module_el8.7.0+3286+227f3cf0ALSA-2022:7628
AlmaLinux 8php-dbaFixed7.4.30-1.module_el8.7.0+3286+227f3cf0ALSA-2022:7628
AlmaLinux 8php-dbgFixed7.4.30-1.module_el8.7.0+3286+227f3cf0ALSA-2022:7628
AlmaLinux 8php-develFixed7.4.30-1.module_el8.7.0+3286+227f3cf0ALSA-2022:7628
AlmaLinux 8php-embeddedFixed7.4.30-1.module_el8.7.0+3286+227f3cf0ALSA-2022:7628
AlmaLinux 8php-enchantFixed7.4.30-1.module_el8.7.0+3286+227f3cf0ALSA-2022:7628
AlmaLinux 8php-ffiFixed7.4.30-1.module_el8.7.0+3286+227f3cf0ALSA-2022:7628
AlmaLinux 8php-fpmFixed7.4.30-1.module_el8.7.0+3286+227f3cf0ALSA-2022:7628
AlmaLinux 8php-gdFixed7.4.30-1.module_el8.7.0+3286+227f3cf0ALSA-2022:7628
AlmaLinux 8php-gmpFixed7.4.30-1.module_el8.7.0+3286+227f3cf0ALSA-2022:7628
AlmaLinux 8php-intlFixed7.4.30-1.module_el8.7.0+3286+227f3cf0ALSA-2022:7628
AlmaLinux 8php-jsonFixed7.4.30-1.module_el8.7.0+3286+227f3cf0ALSA-2022:7628
AlmaLinux 8php-ldapFixed7.4.30-1.module_el8.7.0+3286+227f3cf0ALSA-2022:7628
AlmaLinux 8php-mbstringFixed7.4.30-1.module_el8.7.0+3286+227f3cf0ALSA-2022:7628
AlmaLinux 8php-mysqlndFixed7.4.30-1.module_el8.7.0+3286+227f3cf0ALSA-2022:7628
AlmaLinux 8php-odbcFixed7.4.30-1.module_el8.7.0+3286+227f3cf0ALSA-2022:7628
AlmaLinux 8php-opcacheFixed7.4.30-1.module_el8.7.0+3286+227f3cf0ALSA-2022:7628
AlmaLinux 8php-pdoFixed7.4.30-1.module_el8.7.0+3286+227f3cf0ALSA-2022:7628
AlmaLinux 8php-pearFixed1:1.10.13-1.module_el8.6.0+3268+b150a051ALSA-2022:7628
AlmaLinux 8php-pecl-apcuFixed5.1.18-1.module_el8.6.0+3239+bedf0508ALSA-2022:7628
AlmaLinux 8php-pecl-apcu-develFixed5.1.18-1.module_el8.6.0+2750+78feabcbALSA-2022:7628
AlmaLinux 8php-pecl-rrdFixed2.0.1-1.module_el8.6.0+3239+bedf0508ALSA-2022:7628
AlmaLinux 8php-pecl-xdebugFixed2.9.5-1.module_el8.6.0+2750+78feabcbALSA-2022:7628
AlmaLinux 8php-pecl-zipFixed1.18.2-1.module_el8.6.0+3239+bedf0508ALSA-2022:7628
AlmaLinux 8php-pgsqlFixed7.4.30-1.module_el8.7.0+3286+227f3cf0ALSA-2022:7628
AlmaLinux 8php-processFixed7.4.30-1.module_el8.7.0+3286+227f3cf0ALSA-2022:7628
AlmaLinux 8php-snmpFixed7.4.30-1.module_el8.7.0+3286+227f3cf0ALSA-2022:7628
AlmaLinux 8php-soapFixed7.4.30-1.module_el8.7.0+3286+227f3cf0ALSA-2022:7628
AlmaLinux 8php-xmlFixed7.4.30-1.module_el8.7.0+3286+227f3cf0ALSA-2022:7628
AlmaLinux 8php-xmlrpcFixed7.4.30-1.module_el8.7.0+3286+227f3cf0ALSA-2022:7628
Rocky Linux 8libzipFixed0:1.6.1-1.module+el8.6.0+789+2130c178RLSA-2022:7628
Rocky Linux 8phpFixed0:7.4.30-1.module+el8.7.0+1067+0a7071ccRLSA-2022:7628
Rocky Linux 8php-pearFixed1:1.10.13-1.module+el8.7.0+1067+0a7071ccRLSA-2022:7628
Rocky Linux 8php-pecl-apcuFixed0:5.1.18-1.module+el8.6.0+789+2130c178RLSA-2022:7628
Rocky Linux 8php-pecl-rrdFixed0:2.0.1-1.module+el8.4.0+414+2e7afcddRLSA-2022:7628
Rocky Linux 8php-pecl-xdebugFixed0:2.9.5-1.module+el8.4.0+415+e936cba3RLSA-2022:7628
Rocky Linux 8php-pecl-zipFixed0:1.18.2-1.module+el8.6.0+789+2130c178RLSA-2022:7628
Alpine Linux 3.19php81Fixed8.1.0-r0ALPINE-CVE-2021-21707
Alpine Linux 3.18php81Fixed8.1.0-r0ALPINE-CVE-2021-21707
Alpine Linux 3.17php81Fixed8.1.0-r0ALPINE-CVE-2021-21707
Alpine Linux 3.16php8Fixed8.0.13-r0ALPINE-CVE-2021-21707
Alpine Linux 3.16php81Fixed8.1.0-r0ALPINE-CVE-2021-21707
Alpine Linux 3.15php7Fixed7.4.26-r0ALPINE-CVE-2021-21707
Alpine Linux 3.15php8Fixed8.0.13-r0ALPINE-CVE-2021-21707
Alpine Linux 3.14php7Fixed7.4.26-r0ALPINE-CVE-2021-21707
Alpine Linux 3.14php8Fixed8.0.13-r0ALPINE-CVE-2021-21707
Alpine Linux 3.13php7Fixed7.4.26-r0ALPINE-CVE-2021-21707
Alpine Linux 3.13php8Fixed8.0.13-r0ALPINE-CVE-2021-21707
Alpine Linux 3.12php7Fixed7.3.33-r0ALPINE-CVE-2021-21707

What the vendor says

As published in the CVE record by php, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

Vendor advisories:

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.