php: command line arguments injection when run in CGI mode (VU#520827)
Published May 11, 2012 ·Due Apr 15, 2022
9.8
CRITICALCVSS 3.1
EPSS 100.00%
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.
Affected products
No data.
Configuration 2
- 39
- 40
Configuration 3
- 6.0
Configuration 5
- 11.4
- 12.1
- 10
- 11
- 11
- 10
- 11
Configuration 7
- 2.0
- 2.0
- 2.0
- 2.0
- 6.0
- 5.6
- 6.1
- 6.2
- 5.0
- 6.0
- 5.3
- 5.6
- 5.0
- 6.0
No data.
Red Hat Enterprise Linux 5
php-0:5.1.6-34.el5_8
Fixed · RHSA-2012:0546
Red Hat Enterprise Linux 5
php53-0:5.3.3-7.el5_8
Fixed · RHSA-2012:0547
Red Hat Enterprise Linux 5.3 Long Life
php-0:5.1.6-23.3.el5_3
Fixed · RHSA-2012:0568
Red Hat Enterprise Linux 5.6 EUS - Server Only
php-0:5.1.6-27.el5_6.4
Fixed · RHSA-2012:0568
Red Hat Enterprise Linux 5.6 EUS - Server Only
php53-0:5.3.3-1.el5_6.2
Fixed · RHSA-2012:0569
Red Hat Enterprise Linux 6
php-0:5.3.3-3.el6_2.8
Fixed · RHSA-2012:0546
Red Hat Enterprise Linux 6.0 EUS - Server Only
php-0:5.3.2-6.el6_0.2
Fixed · RHSA-2012:0568
Red Hat Enterprise Linux 6.1 EUS - Server Only
php-0:5.3.3-3.el6_1.4
Fixed · RHSA-2012:0568
Red Hat Enterprise Linux 4
php
Not affected
| Product | Package | State | Advisory |
|---|---|---|---|
| Red Hat Enterprise Linux 5 | php-0:5.1.6-34.el5_8 | Fixed | RHSA-2012:0546 |
| Red Hat Enterprise Linux 5 | php53-0:5.3.3-7.el5_8 | Fixed | RHSA-2012:0547 |
| Red Hat Enterprise Linux 5.3 Long Life | php-0:5.1.6-23.3.el5_3 | Fixed | RHSA-2012:0568 |
| Red Hat Enterprise Linux 5.6 EUS - Server Only | php-0:5.1.6-27.el5_6.4 | Fixed | RHSA-2012:0568 |
| Red Hat Enterprise Linux 5.6 EUS - Server Only | php53-0:5.3.3-1.el5_6.2 | Fixed | RHSA-2012:0569 |
| Red Hat Enterprise Linux 6 | php-0:5.3.3-3.el6_2.8 | Fixed | RHSA-2012:0546 |
| Red Hat Enterprise Linux 6.0 EUS - Server Only | php-0:5.3.2-6.el6_0.2 | Fixed | RHSA-2012:0568 |
| Red Hat Enterprise Linux 6.1 EUS - Server Only | php-0:5.3.3-3.el6_1.4 | Fixed | RHSA-2012:0568 |
| Red Hat Enterprise Linux 4 | php | Not affected | n/a |
No package ranges for this CVE.
Remediation
Red Hat statement
This flaw did not affect the versions of PHP in Red Hat Enterprise Linux 3 or 4. Updates were released for Red Hat Enterprise Linux 5 and 6 (RHSA-2012:0546, RHSA-2012:0547), Red Hat Enterprise Linux 5.3 Long Life (RHSA-2012:0568), Red Hat Enterprise Linux 5.6, 6.0, and 6.1 Extended Update Support (RHSA-2012:0568, RHSA-2012:0569), and Red Hat Application Stack v2 (RHSA-2012:0570). This flaw only affected PHP CGI configurations and it did not affect the default configuration in Red Hat Enterprise Linux 5 and 6 using the PHP module for Apache httpd to handle PHP scripts. Note that this issue was not fixed completely the first time, which resulted in the assignment of additional related CVE identifiers - CVE-2012-2311, CVE-2012-2335, and CVE-2012-2336. Refer to the Red Hat CVE Database and the Red Hat Bugzilla for additional information on how those CVEs affect Red Hat products.
Metrics
No CVSS v4.0 score for this CVE.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
No CVSS v3.0 score for this CVE.
AV:N/AC:L/Au:N/C:P/I:P/A:P
Date Added
Mar 25, 2022
Patch Due
Apr 15, 2022
Required Action
Apply updates per vendor instructions.
CISA SSVC (Vulnrichment)
Stakeholder-Specific Vulnerability Categorization from CISA ADP.
Exploitation
ActiveAutomatable
YesTechnical Impact
TotalDecision
n/aAssessed Feb 7, 2025 · SSVC 2.0.3
Estimated probability of exploitation in the wild in the next 30 days (FIRST EPSS). As of Oct 1, 2026.
Score over time
2022–2026- EPSS v2
- EPSS v3
- EPSS v4
- EPSS v5
Percentile over time
- EPSS v2
- EPSS v3
- EPSS v4
- EPSS v5
Table of values (15 key points)
Flat stretches are collapsed; showing up to 120 newest points.
| Date | Score | Percentile | Model |
|---|---|---|---|
| Oct 1, 2026 | 100.00% (0.99998) | 99.99th | v5 (v2026.06.15) |
| Jun 15, 2026 | 100.00% (0.99998) | 99.99th | v5 (v2026.06.15) |
| Mar 17, 2025 | 94.42% (0.94424) | 99.98th | v4 (v2025.03.14) |
| Dec 12, 2024 | 95.14% (0.95142) | 99.42th | v3 (v2023.03.01) |
| Oct 25, 2024 | 95.14% (0.95142) | 99.39th | v3 (v2023.03.01) |
| Jul 17, 2024 | 92.03% (0.92025) | 98.97th | v3 (v2023.03.01) |
| Jun 11, 2024 | 97.31% (0.97309) | 99.87th | v3 (v2023.03.01) |
| May 30, 2024 | 97.44% (0.97442) | 99.95th | v3 (v2023.03.01) |
| Apr 6, 2024 | 97.36% (0.97363) | 99.89th | v3 (v2023.03.01) |
| Feb 8, 2024 | 97.41% (0.97411) | 99.92th | v3 (v2023.03.01) |
| Jun 5, 2023 | 97.49% (0.97494) | 99.95th | v3 (v2023.03.01) |
| Apr 1, 2023 | 97.53% (0.97533) | 99.98th | v3 (v2023.03.01) |
| Mar 7, 2023 | 97.54% (0.97540) | 99.99th | v3 (v2023.03.01) |
| Mar 6, 2023 | 92.68% (0.92683) | 99.91th | v2 (v2022.01.01) |
| Feb 4, 2022 | 92.68% (0.92683) | 99.90th | v2 (v2022.01.01) |
References (36)
- http://eindbazen.net/2012/05/php-cgi-advisory-cve-2012-1823/ Broken LinkExploit
- http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=c03360041 vendor-advisoryBroken Link
- http://lists.apple.com/archives/security-announce/2012/Sep/msg00004.html vendor-advisoryMailing ListThird Party Advisory
- http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00002.html vendor-advisoryMailing ListThird Party Advisory
- http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00007.html vendor-advisoryMailing ListThird Party Advisory
- http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00011.html vendor-advisoryMailing ListThird Party Advisory
- http://marc.info/?l=bugtraq&m=134012830914727&w=2 vendor-advisoryMailing List
- http://rhn.redhat.com/errata/RHSA-2012-0546.html vendor-advisoryThird Party Advisory
- http://rhn.redhat.com/errata/RHSA-2012-0547.html vendor-advisoryThird Party Advisory
- http://rhn.redhat.com/errata/RHSA-2012-0568.html vendor-advisoryThird Party Advisory
- http://rhn.redhat.com/errata/RHSA-2012-0569.html vendor-advisoryThird Party Advisory
- http://rhn.redhat.com/errata/RHSA-2012-0570.html vendor-advisoryThird Party Advisory
- http://secunia.com/advisories/49014 third-party-advisoryBroken Link
- http://secunia.com/advisories/49065 third-party-advisoryBroken Link
- http://secunia.com/advisories/49085 third-party-advisoryBroken Link
- http://secunia.com/advisories/49087 third-party-advisoryBroken Link
- http://support.apple.com/kb/HT5501 Third Party Advisory
- http://www.debian.org/security/2012/dsa-2465 vendor-advisoryThird Party Advisory
- http://www.kb.cert.org/vuls/id/520827 third-party-advisoryExploitThird Party AdvisoryUS Government Resource
- http://www.kb.cert.org/vuls/id/673343 third-party-advisoryThird Party AdvisoryUS Government Resource
- http://www.mandriva.com/security/advisories?name=MDVSA-2012:068 vendor-advisoryBroken Link
- http://www.openwall.com/lists/oss-security/2024/06/07/1 mailing-listMailing List
- http://www.php.net/ChangeLog-5.php#5.4.2 ExploitPatchRelease Notes
- http://www.php.net/archive/2012.php#id2012-05-03-1 Release Notes
- http://www.securitytracker.com/id?1027022 vdb-entryBroken LinkThird Party AdvisoryVDB Entry
- https://access.redhat.com/security/cve/CVE-2012-1823 Vendor Advisory
- https://bugs.php.net/bug.php?id=61910 ExploitPatch
- https://bugs.php.net/patch-display.php?bug_id=61910&patch=cgi.diff&revision=1335984315&display=1 Patch
- https://bugzilla.redhat.com/show_bug.cgi?id=818607 Issue Tracking
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/PKGTQUOA2NTZ3RXN22CSAUJPIRUYRB4B/ vendor-advisoryMailing ListRelease Notes
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/W45DBOH56NQDRTOM2DN2LNA2FZIMC3PK/ vendor-advisoryMailing ListRelease Notes
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PKGTQUOA2NTZ3RXN22CSAUJPIRUYRB4B/ Mailing ListRelease Notes
- https://nvd.nist.gov/vuln/detail/CVE-2012-1823
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2012-1823 government-resourceUS Government Resource
- https://www.cve.org/CVERecord?id=CVE-2012-1823
Change history (0)
No recorded changes yet.