vendor:
PHP
by:
Stefan Esser
7.5
CVSS
HIGH
Remote Code Execution
Unknown
CWE
Product Name: PHP
Affected Version From: PHP 4/5
Affected Version To: Unknown
Patch Exists: NO
Related CWE: Unknown
CPE:
Platforms Tested:
2007
PHP array_user_key_compare() ZVAL dtor exploit
This is a proof of concept code from the Hardened-PHP Project. It exploits a vulnerability in the array_user_key_compare() function in PHP 4/5, allowing for remote code execution. The code starts with a NOP sled followed by shellcode that creates a bindshell on port 4444. It then creates an array with a specially crafted key that triggers the vulnerability. The array is sorted using the array_compare() function, which manipulates the key to point to a controlled memory address. Finally, the exploit creates another array with the shellcode as the key.
Mitigation:
Upgrade to a patched version of PHP or apply the vendor-supplied patch. Additionally, ensure that remote file inclusion protection mechanisms are in place.