CVE-2012-1823
CriticalExploitedPublic exploitphp: 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. Public exploit code is available.
- 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.
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
Exploited in the wild
Yes
4 catalog listings
Public exploit code
Available
Proof-of-concept or weaponized module
Get the full CVE-2012-1823 brief as a PDF
Every affected product and fixed release, exploitation status and a first 24 hours response checklist, emailed within minutes.
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
297 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 ('Command Injection')
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.
Public exploit code is available.
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 Running On Your Attack Surface?
Brandefense maps vulnerabilities like this one to your internet-facing assets and tells you exactly where to patch.
Request A Demo