CVE-2012-1823: PHP - Command Injection
- Cve: CVE-2012-1823
- Name: PHP - Command Injection
- Description: 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.
- Impact: Attackers can execute arbitrary code remotely by crafting specific query strings, leading to full server compromise.
- Remediation: Update PHP to version 5.3.12, 5.4.2, or later versions where the issue is fixed.
- Vulnerability type: command_injection
- Vulnerability impact: remote_code_execution
- Requirement type: none
- Labels source: projectdiscovery
- Severity: critical
- Cvss score: 9.8
- Cvss vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Epss score: 0.99998
- Epss percentile: 0.99991
- Assignee: [email protected]
- Published at: 2012-05-11T10:15:48Z
- Age in days: 5310
- Modified at: 2026-06-16T23:40:22Z
- Patch available: yes
- Public exploits total: 26
- References total: 34
- Products total: 17
- Oss: yes
- Projects total: 1
- Advisory url: https://nvd.nist.gov/vuln/detail/CVE-2012-1823
- Nvd status: analyzed
- Checked, none or zero: public exploits capped, rejected by nvd
- Not known: requirements
Cwe
| Id | Name |
|---|---|
| CWE-77 | Improper Neutralization of Special Elements used in a Command |
Known exploited entries
| List | Added date | Due date | Ransomware use |
|---|---|---|---|
| cisa | 2022-03-25 | 2022-04-15 | no |
| vulncheck | 2012-06-19 | — | no |
Nuclei templates
| Id | Url |
|---|---|
| CVE-2012-1823 | https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2012/CVE-2012-1823.yaml |
Hackerone
- Reports: 3
- Rank: 3235
Public exploits
| Url | Source | Added date |
|---|---|---|
| http://eindbazen.net/2012/05/php-cgi-advisory-cve-2012-1823/ | nvd | 2012-05-11 |
| http://www.kb.cert.org/vuls/id/520827 | nvd | 2012-05-11 |
| http://www.php.net/ChangeLog-5.php#5.4.2 | nvd | 2012-05-11 |
| https://bugs.php.net/bug.php?id=61910 | nvd | 2012-05-11 |
| https://github.com/CyberCTF/vulhub-php-cve-2012-1823 | poc-in-github | 2026-10-08 |
References
Same in every row:
- Source: nvd
| Url | Tags |
|---|---|
| http://www.php.net/ChangeLog-5.php#5.4.2 | Exploit, Patch, Release Notes |
| https://bugs.php.net/bug.php?id=61910 | Exploit, Patch |
| https://bugs.php.net/patch-display.php?bug_id=61910&patch=cgi.diff&revision=1335984315&display=1 | Patch |
| http://www.kb.cert.org/vuls/id/520827 | Exploit, Third Party Advisory, US Government Resource |
| http://lists.apple.com/archives/security-announce/2012/Sep/msg00004.html | Mailing List, Third Party Advisory |
| http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00002.html | Mailing List, Third Party Advisory |
| http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00007.html | Mailing List, Third Party Advisory |
| http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00011.html | Mailing List, Third Party Advisory |
| http://rhn.redhat.com/errata/RHSA-2012-0546.html | Third Party Advisory |
| http://rhn.redhat.com/errata/RHSA-2012-0547.html | Third Party Advisory |
Products
Same in every row:
- Platform bound: no
- Sources: nvd
| Product | Affected | Url |
|---|---|---|
| php:php | >= 5.4.0, < 5.4.2; < 5.3.12 | /v1/products/php/php |
| debian:debian_linux | = 6.0 | /v1/products/debian/debian_linux |
| fedoraproject:fedora | = 40, = 39 | /v1/products/fedoraproject/fedora |
| apple:mac_os_x | >= 10.8.0, < 10.8.2; >= 10.6.8, < 10.7.5 | /v1/products/apple/mac_os_x |
| redhat:enterprise_linux_desktop | = 6.0 | /v1/products/redhat/enterprise_linux_desktop |
| redhat:enterprise_linux_server | = 6.0, = 5.0 | /v1/products/redhat/enterprise_linux_server |
| redhat:enterprise_linux_workstation | = 6.0, = 5.0 | /v1/products/redhat/enterprise_linux_workstation |
| opensuse:opensuse | = 12.1, = 11.4 | /v1/products/opensuse/opensuse |
| redhat:enterprise_linux_server_aus | = 5.6, = 5.3 | /v1/products/redhat/enterprise_linux_server_aus |
| redhat:enterprise_linux_eus | = 6.2, = 6.1, = 5.6 | /v1/products/redhat/enterprise_linux_eus |
Projects
| Repository | Link kinds | Indexed | Url |
|---|---|---|---|
| php/php-src | fix | yes | /v1/repositories/php/php-src |
Index
- Checked, none or zero: repositories, repositories high signal, packages
Exploitation
- Known exploited: yes
- Known exploited since: 2022-03-25
- Known exploited by: cisa, vulncheck
- Vulncheck known exploited since: 2012-06-19
- Exploitation seen: yes
- Public exploit: yes
- Public exploit count: 26
- Public exploit first date: 2012-05-03
- Remote: yes
- Hackerone reports: 3
- Exposed hosts: 6175026
- Checked, none or zero: initial access, authentication required
- Not known: initial access since