OS Command Injection in PHP - CVE-2024-4577

 

OS Command Injection in PHP - CVE-2024-4577

Published: June 4, 2024 / Updated: March 18, 2025


Vulnerability identifier: #VU91106
CSH Severity: Critical
CVSS v4: 9.3 [CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N]
CVE-ID: CVE-2024-4577
CWE-ID: CWE-78
Exploitation vector: Remote access
Exploit availability: The vulnerability is being exploited in the wild

Vulnerability details

The vulnerability allows a remote attacker to execute arbitrary shell commands on the target system.

The vulnerability exists due to improper input validation in PHP-CGI implementation. A remote attacker can send specially crafted HTTP request to the application and execute arbitrary OS commands on the system.

Note, the vulnerability exists due to incomplete fix for #VU4201 (CVE-2012-1823).

Affected software

PHP
Gentoo Linux
Slackware Linux
openEuler
Anolis OS
Fedora
Oracle Solaris
EasyApache
Oracle SD-WAN Aware
php-pdo
php-gd
php-gmp
php-help
php-intl
php-ldap
php-mbstring
php-mysqlnd
php-odbc
php-opcache
php-ffi
php-pgsql
php-process
php-snmp
php-soap
php-sodium
php-tidy
php-fpm
php-enchant
php-embedded
php-devel
php-debugsource
php-debuginfo
php-dbg
php-dba
php-common
php-cli
php-bcmath
php
php-xml
php81
php-zip

How to mitigate CVE-2024-4577

Install updates from vendor's website.

PHP - addressed in versions 8.1.29, 8.2.20, 8.3.8
EasyApache - addressed in versions 4 2024-6-10, 4 2024-10-2
php-pdo - update to 8.0.30-6
php-gd - update to 8.0.30-6
php-gmp - update to 8.0.30-6
php-help - update to 8.0.30-6
php-intl - update to 8.0.30-6
php-ldap - update to 8.0.30-6
php-mbstring - update to 8.0.30-6
php-mysqlnd - update to 8.0.30-6
php-odbc - update to 8.0.30-6
php-opcache - update to 8.0.30-6
php-ffi - update to 8.0.30-6
php-pgsql - update to 8.0.30-6
php-process - update to 8.0.30-6
php-snmp - update to 8.0.30-6
php-soap - update to 8.0.30-6
php-sodium - update to 8.0.30-6
php-tidy - update to 8.0.30-6
php-fpm - update to 8.0.30-6
php-enchant - update to 8.0.30-6
php-embedded - update to 8.0.30-6
php-devel - update to 8.0.30-6
php-debugsource - update to 8.0.30-6
php-debuginfo - update to 8.0.30-6
php-dbg - update to 8.0.30-6
php-dba - update to 8.0.30-6
php-common - update to 8.0.30-6
php-cli - update to 8.0.30-6
php-bcmath - update to 8.0.30-6
php - update to 8.0.30-6
php-xml - update to 8.0.30-6
php81 - addressed in versions 8.1.29, 8.1.30
php - addressed in versions 8.2.20-1.fc39, 8.2.24-1.fc39, 8.3.8-1.fc40, 8.3.12-1.fc40
php-soap - update to 8.2.24-1
php-sodium - update to 8.2.24-1
php-xml - update to 8.2.24-1
php-zip - update to 8.2.24-1
php-snmp - update to 8.2.24-1
php-process - update to 8.2.24-1
php-pgsql - update to 8.2.24-1
php-pdo - update to 8.2.24-1
php-opcache - update to 8.2.24-1
php-odbc - update to 8.2.24-1
php-mysqlnd - update to 8.2.24-1
php-mbstring - update to 8.2.24-1
php-ldap - update to 8.2.24-1
php-intl - update to 8.2.24-1
php-gmp - update to 8.2.24-1
php-gd - update to 8.2.24-1
php-fpm - update to 8.2.24-1
php-ffi - update to 8.2.24-1
php-enchant - update to 8.2.24-1
php-embedded - update to 8.2.24-1
php-devel - update to 8.2.24-1
php-dbg - update to 8.2.24-1
php-dba - update to 8.2.24-1
php-common - update to 8.2.24-1
php-cli - update to 8.2.24-1
php-bcmath - update to 8.2.24-1
php - update to 8.2.24-1
Oracle Solaris - addressed in versions 11.4 SRU 71, 11.4 SRU 77

Links to Public Exploits and PoC-codes

External References

Related Security Bulletins