vendor:
PHP
by:
NetJackal
7.5
CVSS
HIGH
Safe_mode Bypass
284
CWE
Product Name: PHP
Affected Version From: PHP 5.0.5
Affected Version To:
Patch Exists: NO
Related CWE:
CPE: a:php:php:5.0.5
Platforms Tested:
2007
PHP FFI Extension Safe_mode Bypass Exploit
This PHP script exploits a vulnerability in the PHP FFI extension to bypass the safe_mode restriction. It allows an attacker to execute arbitrary commands on the target system by passing the command as a parameter in the URL. The script checks if the FFI extension is loaded and then proceeds to execute the command using the WinExec function from the kernel32.dll library. The output of the command is stored in a temporary file, which is read and displayed on the web page. The temporary file is then deleted.
Mitigation:
The FFI extension is no longer supported in modern versions of PHP. It is recommended to update to a supported version and remove the FFI extension if it is present. Additionally, enabling safe_mode in PHP configuration can help mitigate the risk of this vulnerability.