CVE-2012-1823 Details
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.
A vulnerability exists in PHP versions prior to 5.3.12 and 5.4.x prior to 5.4.2, when PHP is run as a CGI script. The issue arises because the CGI executable improperly processes query strings that lack an equals sign, allowing remote attackers to inject command-line options that can be exploited to execute arbitrary code. This vulnerability is related to the 'd' command-line option and the way PHP's 'php_getopt' function handles query strings.
Users can upgrade to PHP versions 5.3.13 or 5.4.3, both of which include patches that address this vulnerability. After upgrading, the web server should be restarted to apply the changes.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Feb 7, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
This CVE is in CISA's Known Exploited Vulnerabilities Catalog
Reference CISA's BOD 22-01 and Known Exploited Vulnerabilities Catalog for further guidance and requirements.
| Vulnerability Name | Date Added | Due Date | Required Action |
|---|---|---|---|
| PHP-CGI Query String Parameter Vulnerability | Mar 25, 2022 | Apr 15, 2022 | Apply updates per vendor instructions. |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-77 | Improper Neutralization of Special Elements used in a Command ('Command Injection') | [email protected] |
| CWE-77 | Improper Neutralization of Special Elements used in a Command ('Command Injection') | CISA-ADP |
Affected Products
| Product | Versions |
|---|---|
| php php | < 5.3.12 >= 5.4.0, < 5.4.2 |
CPE
Remediation
| |
| fedoraproject fedora | 39 40 |
CPE
Remediation
| |
| debian debian linux | 6.0 |
CPE
Remediation
| |
| hp hp-ux | b.11.23 b.11.31 |
CPE
Remediation
| |
| opensuse opensuse | 11.4 12.1 |
CPE
Remediation
| |
| suse linux enterprise server | 10 sp4 11 sp2 |
CPE
Remediation
| |
| suse linux enterprise software development kit | 10 sp4 11 sp2 |
CPE
Remediation
| |
| apple mac os x | >= 10.6.8, < 10.7.5 >= 10.8.0, < 10.8.2 |
CPE
Remediation
| |
| redhat application stack | 2.0 |
CPE
Remediation
| |
| redhat gluster storage server for on-premise | 2.0 |
CPE
Remediation
| |
| redhat storage | 2.0 |
CPE
Remediation
| |
| redhat storage for public cloud | 2.0 |
CPE
Remediation
| |
| redhat enterprise linux desktop | 6.0 |
CPE
Remediation
| |
| redhat enterprise linux eus | 5.6 6.1 6.2 |
CPE
Remediation
| |
| redhat enterprise linux server | 5.0 6.0 |
CPE
Remediation
| |
| redhat enterprise linux server aus | 5.3 5.6 |
CPE
Remediation
| |
| redhat enterprise linux workstation | 5.0 6.0 |
CPE
Remediation
| |
Change History
19 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 16, 2026 | CVE Modified | CISA-ADP |
| Jun 16, 2026 | CVE Modified | [email protected] |
| Apr 21, 2026 | Modified Analysis | [email protected] |
| Nov 4, 2025 | CVE Modified | CVE |
| Oct 22, 2025 | CVE Modified | CISA-ADP |
| Oct 21, 2025 | CVE Modified | CISA-ADP |
| Oct 21, 2025 | CVE Modified | CISA-ADP |
| Feb 19, 2025 | Modified Analysis | [email protected] |
| Feb 7, 2025 | CVE Modified | CISA-ADP |
| Jan 6, 2025 | Modified Analysis | [email protected] |
| Nov 21, 2024 | CVE Modified | CVE |
| Jul 16, 2024 | Modified Analysis | [email protected] |
| Jun 13, 2024 | CVE Modified | [email protected] |
| Jun 12, 2024 | CVE Modified | [email protected] |
| Jun 10, 2024 | CVE Modified | [email protected] |
| May 14, 2024 | CVE Modified | [email protected] |
| Jan 18, 2018 | CVE Modified | [email protected] |
| Jan 5, 2018 | CVE Modified | [email protected] |
| May 11, 2012 | Initial Analysis | [email protected] |