Skip to content
OpenAdvisories
Medium · 5.3 Public exploit CVE-2021-21707 EUVD-2021-8879GHSA-qh78-qfw9-93x9

Special characters break path parsing in XML functions

Published Nov 29, 2021 · Updated Sep 17, 2024 · Assigned by php

Description

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.

Affected products

VendorProductAffectedFixed
PHP Group PHP 7.3.x – < 7.3.33, 7.4.x – < 7.4.26, 8.0.X – < 8.0.13 7.3.33

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 11 php7.4 7.4.28-1+deb11u1 DSA-5082-1
Debian 10 php7.3 7.3.31-1~deb10u2 DLA-3243-1
ReleasePackageFixed inAdvisory
Ubuntu 20.04 LTS php7.4 7.4.3-4ubuntu2.10 USN-5300-2
Ubuntu 18.04 LTS php7.2 7.2.24-0ubuntu0.18.04.11 USN-5300-2
Show 2 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu Pro 16.04 LTS php7.0 7.0.33-0ubuntu0.16.04.16+esm3 USN-5300-1
Ubuntu Pro 14.04 LTS php5 No fix yet —
ReleasePackageFixed inAdvisory
RHEL 8 apcu-panel +2 5.1.18-1.module+el8.3.0+6678+b09f589e RHSA-2022:7628
RHEL 8 libzip +2 1.6.1-1.module+el8.3.0+6678+b09f589e RHSA-2022:7628
RHEL 8 php +25 7.4.30-1.module+el8.7.0+15886+8e29b882 RHSA-2022:7628
RHEL 8 php-pear 1:1.10.13-1.module+el8.7.0+15127+a450a8db RHSA-2022:7628
RHEL 8 php-pecl-rrd 2.0.1-1.module+el8.3.0+6678+b09f589e RHSA-2022:7628
RHEL 8 php-pecl-xdebug 2.9.5-1.module+el8.3.0+6678+b09f589e RHSA-2022:7628
RHEL 8 php-pecl-zip 1.18.2-1.module+el8.3.0+6678+b09f589e RHSA-2022:7628
RHEL 3 rh-php73-php +27 7.3.33-1.el7 RHSA-2022:5491

AlmaLinux

Errata ↗
ReleasePackageFixed inAdvisory
AlmaLinux 8 apcu-panel +2 5.1.18-1.module_el8.6.0+2750+78feabcb ALSA-2022:7628
AlmaLinux 8 libzip +2 1.6.1-1.module_el8.6.0+2750+78feabcb ALSA-2022:7628
AlmaLinux 8 php +25 7.4.30-1.module_el8.7.0+3286+227f3cf0 ALSA-2022:7628
AlmaLinux 8 php-pear 1:1.10.13-1.module_el8.6.0+3268+b150a051 ALSA-2022:7628
AlmaLinux 8 php-pecl-rrd 2.0.1-1.module_el8.6.0+2750+78feabcb ALSA-2022:7628
AlmaLinux 8 php-pecl-xdebug 2.9.5-1.module_el8.6.0+2750+78feabcb ALSA-2022:7628
AlmaLinux 8 php-pecl-zip 1.18.2-1.module_el8.6.0+2750+78feabcb ALSA-2022:7628

Rocky Linux

Errata ↗
ReleasePackageFixed inAdvisory
Rocky Linux 8 libzip 1.6.1-1.module+el8.4.0+415+e936cba3 RLSA-2022:7628
Rocky Linux 8 php 7.4.30-1.module+el8.7.0+1067+0a7071cc RLSA-2022:7628
Rocky Linux 8 php-pear 1:1.10.13-1.module+el8.6.0+1006+0d5a469f RLSA-2022:7628
Rocky Linux 8 php-pecl-apcu 5.1.18-1.module+el8.4.0+415+e936cba3 RLSA-2022:7628
Rocky Linux 8 php-pecl-rrd 2.0.1-1.module+el8.4.0+414+2e7afcdd RLSA-2022:7628
Rocky Linux 8 php-pecl-xdebug 2.9.5-1.module+el8.4.0+415+e936cba3 RLSA-2022:7628
Rocky Linux 8 php-pecl-zip 1.18.2-1.module+el8.4.0+415+e936cba3 RLSA-2022:7628
ReleasePackageFixed inAdvisory
SLES 15 SP4 php7 +4 7.4.25-150400.4.8.1 SUSE-SU-2022:3997-1, SUSE-SU-2022:2292-1
SLES 15 SP4 php8 +5 8.0.10-150400.4.8.1 SUSE-SU-2022:2303-1
SLES 15 SP3 php7 7.4.6-3.29.1 SUSE-SU-2022:4069-1, SUSE-SU-2021:3943-1
SLES 15 SP2 php7 7.4.6-3.29.1 SUSE-SU-2022:4069-1, SUSE-SU-2021:3943-1
SLES 15 SP1 php7 7.2.5-4.89.4 SUSE-SU-2022:4067-1, SUSE-SU-2022:0679-1
SLES 15 php7 7.2.5-4.89.4 SUSE-SU-2022:4067-1, SUSE-SU-2022:0679-1
Show 13 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SLES 12 SP5 php72 7.2.5-1.75.1 SUSE-SU-2022:0577-1
SLES 12 SP5 php74 7.4.6-1.30.1 SUSE-SU-2022:4068-1, SUSE-SU-2021:3927-1
SLES 12 php72 7.2.5-1.75.1 SUSE-SU-2022:0577-1
SLES 12 php74 7.4.6-1.30.1 SUSE-SU-2022:4068-1, SUSE-SU-2021:3927-1
SLES for SAP 15 SP2 php7 7.4.33-150200.3.46.2 SUSE-SU-2022:4069-1
SLES for SAP 15 SP1 php7 7.2.5-4.89.4 SUSE-SU-2022:4067-1, SUSE-SU-2022:0679-1
SLES for SAP 15 php7 7.2.5-4.89.4 SUSE-SU-2022:4067-1, SUSE-SU-2022:0679-1
SLE HPC 15 SP2 php7 7.4.33-150200.3.46.2 SUSE-SU-2022:4069-1
SLE HPC 15 SP1 php7 7.2.5-4.89.4 SUSE-SU-2022:4067-1, SUSE-SU-2022:0679-1
SLE HPC 15 php7 7.2.5-4.89.4 SUSE-SU-2022:4067-1, SUSE-SU-2022:0679-1
SUSE Manager Server 4.1 php7 7.4.33-150200.3.46.2 SUSE-SU-2022:4069-1
SUSE Manager Retail Branch Server 4.1 php7 7.4.33-150200.3.46.2 SUSE-SU-2022:4069-1
SUSE Manager Proxy 4.1 php7 7.4.33-150200.3.46.2 SUSE-SU-2022:4069-1
SUSE Enterprise Storage 7 php7 7.4.33-150200.3.46.2 SUSE-SU-2022:4069-1
SUSE Enterprise Storage 6 php7 7.2.5-4.89.4 SUSE-SU-2022:4067-1, SUSE-SU-2022:0679-1
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed php7 7.4.26-1.1 openSUSE-SU-2024:11640-1
openSUSE Tumbleweed php8 8.0.13-1.1 openSUSE-SU-2024:11638-1
openSUSE Leap 15.4 php7 7.2.34-150000.4.103.1 SUSE-SU-2022:4069-1, SUSE-SU-2022:4067-1, SUSE-SU-2022:3997-1
openSUSE Leap 15.4 php7-fpm +4 7.4.25-150400.4.8.1 SUSE-SU-2022:3997-1, SUSE-SU-2022:2292-1
openSUSE Leap 15.4 php8 +5 8.0.10-150400.4.8.1 SUSE-SU-2022:2303-1
openSUSE Leap 15.3 php7 +1 7.4.6-3.29.1 openSUSE-SU-2021:3943-1, SUSE-SU-2022:4069-1
openSUSE Leap 15.2 php7 +1 7.4.6-lp152.2.21.1 openSUSE-SU-2021:1570-1
ReleasePackageFixed inAdvisory
Alpine v3.19 php81 8.1.0-r0 —
Alpine v3.18 php81 8.1.0-r0 —
Alpine v3.17 php81 8.1.0-r0 —
Alpine v3.16 php8 8.0.13-r0 —
Alpine v3.16 php81 8.1.0-r0 —
Alpine v3.15 php7 7.4.26-r0 —
Alpine v3.15 php8 8.0.13-r0 —
Show 3 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Alpine v3.14 php7 7.4.26-r0 —
Alpine v3.14 php8 8.0.13-r0 —
Alpine v3.13 php7 7.4.26-r0 —
Alpine v3.13 php8 8.0.13-r0 —
Alpine v3.12 php7 7.3.33-r0 —

Oracle Linux

ReleasePackageFixed inAdvisory
Oracle Linux 8 apcu-panel +2 5.1.18-1.module+el8.3.0+7685+72d70b58 ELSA-2022-7628
Oracle Linux 8 libzip +2 1.6.1-1.module+el8.3.0+7685+72d70b58 ELSA-2022-7628
Oracle Linux 8 php +25 7.4.30-1.module+el8.7.0+20800+8e29b882 ELSA-2022-7628
Oracle Linux 8 php-pear 1:1.10.13-1.module+el8.7.0+20800+8e29b882 ELSA-2022-7628
Oracle Linux 8 php-pecl-rrd 2.0.1-1.module+el8.3.0+7685+72d70b58 ELSA-2022-7628
Oracle Linux 8 php-pecl-xdebug 2.9.5-1.module+el8.3.0+7685+72d70b58 ELSA-2022-7628
Oracle Linux 8 php-pecl-zip 1.18.2-1.module+el8.3.0+7685+72d70b58 ELSA-2022-7628

Public exploits

Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.

Third-party code, not reviewed by us. Public PoCs are sometimes fake or contain malware. Read the code first and run it only in an isolated lab, against systems you are authorised to test.

GitHub 1 repository

Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.

Advisories 31

References