Heap-based buffer overflow in PHP - CVE-2022-31627
Published: July 14, 2022 / Updated: October 27, 2023
Vulnerability details
The vulnerability allows a remote attacker to execute arbitrary code on the target system.
The vulnerability exists due to a boundary error within the finfo_buffer() PHP function. A remote attacker can pass an overly long string to the script that allocates the buffer, trigger a heap-based buffer overflow and execute arbitrary code on the target system.
Successful exploitation of this vulnerability may result in complete compromise of vulnerable system.
Affected software
Gentoo Linux
Amazon Linux AMI
Oracle Solaris
Ubuntu
Fedora
Junos OS
EasyApache
php8.1-fpm (Ubuntu package)
php8.1-cli (Ubuntu package)
libapache2-mod-php8.1 (Ubuntu package)
php8.1-mysql (Ubuntu package)
php8.1-pgsql (Ubuntu package)
php8.1-cgi (Ubuntu package)
php
php8.1
How to mitigate CVE-2022-31627
EasyApache - update to 4 2022-7-13
php8.1-fpm (Ubuntu package) - update to 8.1.2-1ubuntu2.2
php8.1-cli (Ubuntu package) - update to 8.1.2-1ubuntu2.2
libapache2-mod-php8.1 (Ubuntu package) - update to 8.1.2-1ubuntu2.2
php8.1-mysql (Ubuntu package) - update to 8.1.2-1ubuntu2.2
php8.1-pgsql (Ubuntu package) - update to 8.1.2-1ubuntu2.2
php8.1-cgi (Ubuntu package) - update to 8.1.2-1ubuntu2.2
php - update to 8.1.8-1.fc36
php8.1 - update to 8.1.14-1
Junos OS - update to 23.2R1