SecurityContext

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

IdName
CWE-77Improper Neutralization of Special Elements used in a Command

Known exploited entries

ListAdded dateDue dateRansomware use
cisa2022-03-252022-04-15no
vulncheck2012-06-19—no

Nuclei templates

IdUrl
CVE-2012-1823https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2012/CVE-2012-1823.yaml

Hackerone

  • Reports: 3
  • Rank: 3235

Public exploits

UrlSourceAdded date
http://eindbazen.net/2012/05/php-cgi-advisory-cve-2012-1823/nvd2012-05-11
http://www.kb.cert.org/vuls/id/520827nvd2012-05-11
http://www.php.net/ChangeLog-5.php#5.4.2nvd2012-05-11
https://bugs.php.net/bug.php?id=61910nvd2012-05-11
https://github.com/CyberCTF/vulhub-php-cve-2012-1823poc-in-github2026-10-08

References

Same in every row:

  • Source: nvd
UrlTags
http://www.php.net/ChangeLog-5.php#5.4.2Exploit, Patch, Release Notes
https://bugs.php.net/bug.php?id=61910Exploit, Patch
https://bugs.php.net/patch-display.php?bug_id=61910&patch=cgi.diff&revision=1335984315&display=1Patch
http://www.kb.cert.org/vuls/id/520827Exploit, Third Party Advisory, US Government Resource
http://lists.apple.com/archives/security-announce/2012/Sep/msg00004.htmlMailing List, Third Party Advisory
http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00002.htmlMailing List, Third Party Advisory
http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00007.htmlMailing List, Third Party Advisory
http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00011.htmlMailing List, Third Party Advisory
http://rhn.redhat.com/errata/RHSA-2012-0546.htmlThird Party Advisory
http://rhn.redhat.com/errata/RHSA-2012-0547.htmlThird Party Advisory

Products

Same in every row:

  • Platform bound: no
  • Sources: nvd
ProductAffectedUrl
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

RepositoryLink kindsIndexedUrl
php/php-srcfixyes/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

Nuclei template