CVE-2012-1823PHP Command Injection
php: command line arguments injection when run in CGI mode (VU#520827)
Published May 3, 2012 · Updated Mar 9, 2026
Key Facts
Patch immediately- CVE-2012-1823 is a critical-severity vulnerability (CVSS 9.8 v3.1) affecting PHP, Application Stack (Redhat), Gluster Storage Server For On-Premise (Redhat) and 22 more products.
- It is exploited in the wild, listed in CISA KEV, Industry KEV feed, CIRCL KEV, ENISA EUVD since Jun 19, 2012. A public exploit is reported by tracking sources, but no code link is listed yet.
- EPSS estimates a 100% probability of exploitation in the next 30 days.
- Fixed versions are available, including apache2-mod_php5 5.6.28-1.1, apache2-mod_php7 7.0.14-1.4, Mac OS X 10.7.5.
- Brandefense priority: patch immediately, because it is listed as exploited in the wild.
Scores
CVSS v3.1
9.8
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS (30-day exploit likelihood)
100%
Higher than 99.9% of all scored CVEs
Exploit maturity
Exploited (KEV)
ATLAS score
86/100
Publication score, see How it works
Exploitation Verdict
KEV listed
Mar 25, 2022
3613 days after publication
Federal due date
Apr 15, 2022
Overdue
Ransomware use
Not reported
Attributed actors
Exploit & Defence Guidance
Exploit maturity
Exploited (KEV)
Public exploit code
5
Proof-of-concept links
In-the-wild evidence
14
Reports of active use
Required action (CISA): Apply updates per vendor instructions.
Advisories And Exploit References
- advisoryAPPLE-SA-2012-09-19-2
- advisoryopenSUSE-SU-2012:0590
- advisorySUSE-SU-2012:0598
- advisorySUSE-SU-2012:0604
- advisoryRHSA-2012:0546
- advisoryRHSA-2012:0547
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.
Known-Exploited Catalog Listings
| Catalog | Added | Remediation due | Ransomware use |
|---|---|---|---|
| CISA KEV | Mar 25, 2022 | Apr 15, 2022 | Not reported |
| Industry KEV feed | Jun 19, 2012 | Apr 15, 2022 | Not reported |
| CIRCL KEV | Mar 25, 2022 | Apr 15, 2022 | Not reported |
| ENISA EUVD | Mar 25, 2022 | n/a | Not reported |
Required action: Apply updates per vendor instructions.
Affected Products
300 affected entries in total| Product | Affected versions | Fixed in |
|---|---|---|
| PHPPHP | See advisory | 5.3.12 |
| Application StackRedhat | 2.0 | n/a |
| Gluster Storage Server For On-PremiseRedhat | 2.0 | n/a |
| StorageRedhat | 2.0 | n/a |
| Storage For Public CloudRedhat | 2.0 | n/a |
Patched Releases
apache2-mod_php5
5.6.28-1.1
apache2-mod_php7
7.0.14-1.4
Mac OS X
10.7.5
PHP
0:5.1.6-34.el5_8, 0:5.3.3-3.el6_1.4, 5.1.6-34.el5_8, 5.3.13-1.20.amzn1, 5.3.3-3.el6_2.8, 5.3.12
php-bcmath
5.1.6-34.el5_8, 5.3.13-1.20.amzn1, 5.3.3-3.el6_2.8
php-cli
5.1.6-34.el5_8, 5.3.13-1.20.amzn1, 5.3.3-3.el6_2.8
php-common
5.1.6-34.el5_8, 5.3.13-1.20.amzn1, 5.3.3-3.el6_2.8
php-dba
5.1.6-34.el5_8, 5.3.13-1.20.amzn1, 5.3.3-3.el6_2.8
php-devel
5.1.6-34.el5_8, 5.3.13-1.20.amzn1, 5.3.3-3.el6_2.8
php-embedded
5.3.13-1.20.amzn1, 5.3.3-3.el6_2.8
php-enchant
5.3.3-3.el6_2.8
php-fpm
5.3.13-1.20.amzn1
php-gd
5.1.6-34.el5_8, 5.3.13-1.20.amzn1, 5.3.3-3.el6_2.8
php-imap
5.1.6-34.el5_8, 5.3.13-1.20.amzn1, 5.3.3-3.el6_2.8
php-intl
5.3.13-1.20.amzn1, 5.3.3-3.el6_2.8
php-ldap
5.1.6-34.el5_8, 5.3.13-1.20.amzn1, 5.3.3-3.el6_2.8
php-mbstring
5.1.6-34.el5_8, 5.3.13-1.20.amzn1, 5.3.3-3.el6_2.8
php-mcrypt
5.3.13-1.20.amzn1
php-mssql
5.3.13-1.20.amzn1
php-mysql
5.1.6-34.el5_8, 5.3.13-1.20.amzn1, 5.3.3-3.el6_2.8
php-mysqlnd
5.3.13-1.20.amzn1
php-ncurses
5.1.6-34.el5_8
php-odbc
5.1.6-34.el5_8, 5.3.13-1.20.amzn1, 5.3.3-3.el6_2.8
php-pdo
5.1.6-34.el5_8, 5.3.13-1.20.amzn1, 5.3.3-3.el6_2.8
php-pgsql
5.1.6-34.el5_8, 5.3.13-1.20.amzn1, 5.3.3-3.el6_2.8
Timeline
Publicly disclosed
May 3, 2012
Added to Industry KEV feed
Jun 19, 2012
Added to CISA KEV
Mar 25, 2022
Added to CIRCL KEV
Mar 25, 2022
Added to ENISA EUVD
Mar 25, 2022
Last updated
Mar 9, 2026
Weakness Type
- CWE-77 Improper Neutralization of Special Elements used in a Command
References
- advisoryAPPLE-SA-2012-09-19-2
- advisoryopenSUSE-SU-2012:0590
- advisorySUSE-SU-2012:0598
- advisorySUSE-SU-2012:0604
- advisoryRHSA-2012:0546
FAQ
Common Questions.
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…
Affected: PHP; Application Stack (Redhat) versions 2.0; Gluster Storage Server For On-Premise (Redhat) versions 2.0, among others. The full list is in the CVE brief.
It is exploited in the wild, listed in CISA KEV, Industry KEV feed, CIRCL KEV, ENISA EUVD since Jun 19, 2012.
Yes. It was added on Mar 25, 2022 with a federal remediation due date of Apr 15, 2022.
A public exploit is reported by tracking sources, but no code link is listed yet.
Fixed versions are available, including apache2-mod_php5 5.6.28-1.1, apache2-mod_php7 7.0.14-1.4, Mac OS X 10.7.5.
Brandefense priority: patch immediately, because it is listed as exploited in the wild.
Is CVE-2012-1823 On Your Attack Surface?
Brandefense matches it against the products discovered on your perimeter and opens a finding the day a CVE like this is listed.
Request A Demo