#VU57656 Out-of-bounds write in PHP


Published: 2021-10-26 | Updated: 2023-10-27

Vulnerability identifier: #VU57656

Vulnerability risk: Low

CVSSv3.1: 7.9 [CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H/E:P/RL:O/RC:C]

CVE-ID: CVE-2021-21703

CWE-ID: CWE-787

Exploitation vector: Local

Exploit availability: No

Vulnerable software:
PHP
Universal components / Libraries / Scripting languages

Vendor: PHP Group

Description

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.



Mitigation
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


External links
http://bugs.php.net/bug.php?id=81026
http://www.php.net/ChangeLog-7.php#7.4.25
http://www.php.net/ChangeLog-8.php#8.0.12
http://www.ambionics.io/blog/php-fpm-local-root


Q & A

Can this vulnerability be exploited remotely?

No. This vulnerability can be exploited locally. The attacker should have authentication credentials and successfully authenticate on the system.

Is there known malware, which exploits this vulnerability?

No. We are not aware of malware exploiting this vulnerability. However, proof of concept for this vulnerability is available.


Latest bulletins with this vulnerability