Privilege escalation in PHP

Published: 2021-10-26
Risk Low
Patch available YES
Number of vulnerabilities 1
CVE-ID CVE-2021-21703
Exploitation vector Local
Public exploit Public exploit code for vulnerability #1 is available.
Vulnerable software
Universal components / Libraries / Scripting languages

Vendor PHP Group

Security Bulletin

This security bulletin contains one low risk vulnerability.

1) Out-of-bounds write

EUVDB-ID: #VU57656

Risk: Low


CVE-ID: CVE-2021-21703

CWE-ID: CWE-787 - Out-of-bounds write

Exploit availability: No


The vulnerability allows a local user to escalate privileges on the system.

The vulnerability exists in the way PHP handles shared memory access, when using PHP FPM SAPI with main FPM daemon process running as root and child worker processes running as lower-privileged users. A child process can access shared memory with the main process and write to it. As a result, it is possible to cause the root process to conduct invalid memory reads and writes with root privileges. A local user can trigger an out-of-bounds write error and execute arbitrary code on the system with root privileges.


Install updates from vendor's website.

Vulnerable software versions

PHP: 7.3.0 - 7.3.31, 7.4 - 7.4.24, 8.0.0 - 8.0.11, 7.2 - 7.2.34, 7.1 - 7.1.33, 7.0 - 7.0.33, 5.6.0 - 5.6.40, 5.5 - 5.5.38, 5.4 - 5.4.45, 5.3.7 - 5.3.29

CPE2.3 External links

Q & A

Can this vulnerability be exploited remotely?

Is there known malware, which exploits this vulnerability?