PHP-FPM memory access in root process leading to privilege escalation
Key facts
- Attack vector
- Local
- Privileges required
- Low
- User interaction
- None
- Attack complexity
- High
- Impact type
- Security bypass, Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Partial Red Hat: 3 fixed, 3 without a fix
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and Red Hat. Impact type from CWE-284, CWE-787 and the CVSS impact.
Summary
In PHP versions 7.3.x up to and including 7.3.31, 7.4.x below 7.4.25 and 8.0.x below 8.0.12, when running PHP FPM SAPI with main FPM daemon process running as root and child worker processes running as lower-privileged users, it is possible for the child processes to access memory shared with the main process and write to it, modifying it in a way that would cause the root process to conduct invalid memory reads and writes, which can be used to escalate privileges from local unprivileged user to the root user.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| PHP Group | PHP | 7.3.x – 7.3.31; 7.4.x to before 7.4.25; 8.0.X to before 8.0.12 | 7.4.25, 8.0.12 | Patch available | CNA |
- PHP VendorPHP Group Affected 7.3.x – 7.3.31; 7.4.x to before 7.4.25; 8.0.X to before 8.0.12 Fixed in 7.4.25, 8.0.12 Patch available CNA
CPE configurations NVD · 9
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:php:php:*:*:*:*:*:*:*:* | 7.3.0 – 7.3.31; 7.4.0 to before 7.4.25; 8.0.0 to before 8.0.12 | Vulnerable | PHP |
| cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:* | 9.0 | Vulnerable | Debian |
| cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:* | 10.0 | Vulnerable | Debian |
| cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:* | 11.0 | Vulnerable | Debian |
| cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:* | 33 | Vulnerable | Fedoraproject |
| cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:* | 34 | Vulnerable | Fedoraproject |
| cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:* | 35 | Vulnerable | Fedoraproject |
| cpe:2.3:a:netapp:clustered_data_ontap:-:*:*:*:*:*:*:* | not specified by NVD | Vulnerable | NetApp |
| cpe:2.3:a:oracle:communications_diameter_signaling_router:*:*:*:*:*:*:*:* | 8.0.0.0 – 8.5.0.2 | Vulnerable | Oracle |
- cpe:2.3:a:php:php:*:*:*:*:*:*:*:* Versions 7.3.0 – 7.3.31; 7.4.0 to before 7.4.25; 8.0.0 to before 8.0.12 Vulnerable ·PHP
- cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:* Versions 9.0 Vulnerable ·Debian
- cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:* Versions 10.0 Vulnerable ·Debian
- cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:* Versions 11.0 Vulnerable ·Debian
- cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:* Versions 33 Vulnerable ·Fedoraproject
- cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:* Versions 34 Vulnerable ·Fedoraproject
- cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:* Versions 35 Vulnerable ·Fedoraproject
- cpe:2.3:a:netapp:clustered_data_ontap:-:*:*:*:*:*:*:* Versions not specified by NVD Vulnerable ·NetApp
- cpe:2.3:a:oracle:communications_diameter_signaling_router:*:*:*:*:*:*:*:* Versions 8.0.0.0 – 8.5.0.2 Vulnerable ·Oracle
Remediation
- Fix · CNA PHP (PHP Group) Fixed in 7.4.25, 8.0.12
Red Hat 2 advisories
- RHSA-2022:5491 Released 2022-07-04 · Red Hat rating Importantrh-php73-php security and bug fix update
- Red Hat Software Collections for RHEL Workstation(v. 7) rh-php73-php-7.3.33-1.el7, rh-php73-php-bcmath-7.3.33-1.el7, rh-php73-php-cli-7.3.33-1.el7 +26
- Red Hat Software Collections for RHEL(v. 7) rh-php73-php-7.3.33-1.el7, rh-php73-php-bcmath-7.3.33-1.el7, rh-php73-php-cli-7.3.33-1.el7 +26
- RHSA-2022:1935 Released 2022-05-10 · Red Hat rating Moderatephp:7.4 security update
- Red Hat Enterprise Linux AppStream (v. 8) apcu-panel-5.1.18-1.module+el8.3.0+6678+b09f589e.noarch::php:7.4, libzip-1.6.1-1.module+el8.3.0+6678+b09f589e.aarch64::php:7.4, libzip-1.6.1-1.module+el8.3.0+6678+b09f589e.ppc64le::php:7.4 +47
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Enterprise Linux 6 | Affected | No fix planned: Out of support scope |
| Red Hat Enterprise Linux 7 | Affected | No fix planned: Out of support scope |
| Red Hat Enterprise Linux 8 | Affected | No fix planned: Out of support scope |
| Red Hat Enterprise Linux AppStream (v. 8) | Fixed | RHSA-2022:1935 |
| Red Hat Software Collections for RHEL Workstation(v. 7) | Fixed | RHSA-2022:5491 |
| Red Hat Software Collections for RHEL(v. 7) | Fixed | RHSA-2022:5491 |
Not affected: 1 product
- Red Hat Enterprise Linux 9
Timeline
- 2026-10-02 Threatist record created from CVE-2021-21703
- 2026-10-03 Alias added: GHSA-h8qx-36w6-3rc4
References
Patch 3
More PHP Group vulnerabilities
- TI-2024-04260 Argument Injection in PHP-CGI KEVCVSS 3.1CRITICAL 9.8
- TI-2026-78794 PHP remote code execution via stale global state KEVCVSS 4.0CRITICAL 9.2
- TI-2026-78793 Out-of-memory handling flaw in PHP allows remote code execution KEVCVSS 4.0CRITICAL 9.2
- TI-2024-01743 Command injection via array-ish $command parameter of proc_open() CVSS 3.1CRITICAL 9.4
- TI-2022-13555 PDO::quote() may return unquoted string CVSS 3.1CRITICAL 9.1
- TI-2024-10408 Reference counting in php_request_shutdown causes Use-After-Free CVSS 4.0CRITICAL 9.2
Sources
- CVE-2021-21703 · CVE Program
- CVE-2021-21703 · NVD
- FIRST EPSS
- GHSA-h8qx-36w6-3rc4 · GitHub Advisory Database · CC BY 4.0
- CVE-2021-21703 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences