CVE-2012-1823
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.
What to do
This CVE is being exploited in the wild (CISA Known Exploited Vulnerabilities, added 2022-03-25). If you run an affected version, patch or mitigate now.
Fixed builds are available from Red Hat: see the table below for the fixed version per release.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Red Hat Enterprise Linux 6 | php | Fixed | 0:5.3.3-3.el6_2.8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 6 | php-bcmath | Fixed | 0:5.3.3-3.el6_2.8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 6 | php-cli | Fixed | 0:5.3.3-3.el6_2.8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 6 | php-common | Fixed | 0:5.3.3-3.el6_2.8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 6 | php-dba | Fixed | 0:5.3.3-3.el6_2.8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 6 | php-devel | Fixed | 0:5.3.3-3.el6_2.8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 6 | php-embedded | Fixed | 0:5.3.3-3.el6_2.8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 6 | php-enchant | Fixed | 0:5.3.3-3.el6_2.8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 6 | php-gd | Fixed | 0:5.3.3-3.el6_2.8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 6 | php-imap | Fixed | 0:5.3.3-3.el6_2.8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 6 | php-intl | Fixed | 0:5.3.3-3.el6_2.8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 6 | php-ldap | Fixed | 0:5.3.3-3.el6_2.8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 6 | php-mbstring | Fixed | 0:5.3.3-3.el6_2.8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 6 | php-mysql | Fixed | 0:5.3.3-3.el6_2.8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 6 | php-odbc | Fixed | 0:5.3.3-3.el6_2.8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 6 | php-pdo | Fixed | 0:5.3.3-3.el6_2.8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 6 | php-pgsql | Fixed | 0:5.3.3-3.el6_2.8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 6 | php-process | Fixed | 0:5.3.3-3.el6_2.8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 6 | php-pspell | Fixed | 0:5.3.3-3.el6_2.8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 6 | php-recode | Fixed | 0:5.3.3-3.el6_2.8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 6 | php-snmp | Fixed | 0:5.3.3-3.el6_2.8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 6 | php-soap | Fixed | 0:5.3.3-3.el6_2.8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 6 | php-tidy | Fixed | 0:5.3.3-3.el6_2.8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 6 | php-xml | Fixed | 0:5.3.3-3.el6_2.8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 6 | php-xmlrpc | Fixed | 0:5.3.3-3.el6_2.8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 6 | php-zts | Fixed | 0:5.3.3-3.el6_2.8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 5 | php | Fixed | 0:5.1.6-34.el5_8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 5 | php-bcmath | Fixed | 0:5.1.6-34.el5_8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 5 | php-cli | Fixed | 0:5.1.6-34.el5_8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 5 | php-common | Fixed | 0:5.1.6-34.el5_8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 5 | php-dba | Fixed | 0:5.1.6-34.el5_8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 5 | php-devel | Fixed | 0:5.1.6-34.el5_8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 5 | php-gd | Fixed | 0:5.1.6-34.el5_8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 5 | php-imap | Fixed | 0:5.1.6-34.el5_8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 5 | php-ldap | Fixed | 0:5.1.6-34.el5_8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 5 | php-mbstring | Fixed | 0:5.1.6-34.el5_8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 5 | php-mysql | Fixed | 0:5.1.6-34.el5_8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 5 | php-ncurses | Fixed | 0:5.1.6-34.el5_8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 5 | php-odbc | Fixed | 0:5.1.6-34.el5_8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 5 | php-pdo | Fixed | 0:5.1.6-34.el5_8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 5 | php-pgsql | Fixed | 0:5.1.6-34.el5_8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 5 | php-snmp | Fixed | 0:5.1.6-34.el5_8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 5 | php-soap | Fixed | 0:5.1.6-34.el5_8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 5 | php-xml | Fixed | 0:5.1.6-34.el5_8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 5 | php-xmlrpc | Fixed | 0:5.1.6-34.el5_8 | RHSA-2012:0546 |
| Red Hat Enterprise Linux 5 | php53 | Fixed | 0:5.3.3-7.el5_8 | RHSA-2012:0547 |
| Red Hat Enterprise Linux 5 | php53-bcmath | Fixed | 0:5.3.3-7.el5_8 | RHSA-2012:0547 |
| Red Hat Enterprise Linux 5 | php53-cli | Fixed | 0:5.3.3-7.el5_8 | RHSA-2012:0547 |
| Red Hat Enterprise Linux 5 | php53-common | Fixed | 0:5.3.3-7.el5_8 | RHSA-2012:0547 |
| Red Hat Enterprise Linux 5 | php53-dba | Fixed | 0:5.3.3-7.el5_8 | RHSA-2012:0547 |
| Red Hat Enterprise Linux 5 | php53-devel | Fixed | 0:5.3.3-7.el5_8 | RHSA-2012:0547 |
| Red Hat Enterprise Linux 5 | php53-gd | Fixed | 0:5.3.3-7.el5_8 | RHSA-2012:0547 |
| Red Hat Enterprise Linux 5 | php53-imap | Fixed | 0:5.3.3-7.el5_8 | RHSA-2012:0547 |
| Red Hat Enterprise Linux 5 | php53-intl | Fixed | 0:5.3.3-7.el5_8 | RHSA-2012:0547 |
| Red Hat Enterprise Linux 5 | php53-ldap | Fixed | 0:5.3.3-7.el5_8 | RHSA-2012:0547 |
| Red Hat Enterprise Linux 5 | php53-mbstring | Fixed | 0:5.3.3-7.el5_8 | RHSA-2012:0547 |
| Red Hat Enterprise Linux 5 | php53-mysql | Fixed | 0:5.3.3-7.el5_8 | RHSA-2012:0547 |
| Red Hat Enterprise Linux 5 | php53-odbc | Fixed | 0:5.3.3-7.el5_8 | RHSA-2012:0547 |
| Red Hat Enterprise Linux 5 | php53-pdo | Fixed | 0:5.3.3-7.el5_8 | RHSA-2012:0547 |
| Red Hat Enterprise Linux 5 | php53-pgsql | Fixed | 0:5.3.3-7.el5_8 | RHSA-2012:0547 |
| Red Hat Enterprise Linux 5 | php53-process | Fixed | 0:5.3.3-7.el5_8 | RHSA-2012:0547 |
| Red Hat Enterprise Linux 5 | php53-pspell | Fixed | 0:5.3.3-7.el5_8 | RHSA-2012:0547 |
| Red Hat Enterprise Linux 5 | php53-snmp | Fixed | 0:5.3.3-7.el5_8 | RHSA-2012:0547 |
| Red Hat Enterprise Linux 5 | php53-soap | Fixed | 0:5.3.3-7.el5_8 | RHSA-2012:0547 |
| Red Hat Enterprise Linux 5 | php53-xml | Fixed | 0:5.3.3-7.el5_8 | RHSA-2012:0547 |
| Red Hat Enterprise Linux 5 | php53-xmlrpc | Fixed | 0:5.3.3-7.el5_8 | RHSA-2012:0547 |
| Red Hat Enterprise Linux 4 | php | Not affected |
What the vendor says
As published in the CVE record by certcc, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
Vendor advisories:
- http://marc.info/?l=bugtraq&m=134012830914727&w=2 (vendor-advisory)
- http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00011.html (vendor-advisory)
- http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=c03360041 (vendor-advisory)
- http://www.mandriva.com/security/advisories?name=MDVSA-2012:068 (vendor-advisory)
- http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00002.html (vendor-advisory)
- http://rhn.redhat.com/errata/RHSA-2012-0546.html (vendor-advisory)
References
- http://marc.info/?l=bugtraq&m=134012830914727&w=2
- http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00011.html
- http://www.securitytracker.com/id?1027022
- http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=c03360041
- http://www.mandriva.com/security/advisories?name=MDVSA-2012:068
- http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00002.html
- http://rhn.redhat.com/errata/RHSA-2012-0546.html
- http://rhn.redhat.com/errata/RHSA-2012-0568.html
- http://rhn.redhat.com/errata/RHSA-2012-0569.html
- http://www.php.net/ChangeLog-5.php#5.4.2
- http://secunia.com/advisories/49014
- http://rhn.redhat.com/errata/RHSA-2012-0570.html
- http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00007.html
- https://bugs.php.net/bug.php?id=61910
- http://www.kb.cert.org/vuls/id/673343
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.