CVE-2012-1823: PHP-CGI Query String Parameter Vulnerability

Published May 11, 2012
·
Updated

Fixed bug GHSA-3qgc-jrrr-25jv (Bypass of CVE-2012-1823, Argument Injection in PHP-CGI). (CVE-2024-4577)

Other sources

sapi/cgi/cgimain.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 phpgetopt for the 'd' case.

sapi/cgi/cgimain.c in PHP, when configured as a CGI script, does not properly handle query strings, which allows remote attackers to execute arbitrary code.

CISA

Affected Software

83 affected componentsFixes available
PHP PHP<=5.3.11
PHP PHP=5.0.0
PHP PHP=5.0.0-beta1
PHP PHP=5.0.0-beta2
PHP PHP=5.0.0-beta3
PHP PHP=5.0.0-beta4
PHP PHP=5.0.0-rc1
PHP PHP=5.0.0-rc2
PHP PHP=5.0.0-rc3
PHP PHP=5.0.1
PHP PHP=5.0.2
PHP PHP=5.0.3
PHP PHP=5.0.4
PHP PHP=5.0.5
PHP PHP=5.1.0
PHP PHP=5.1.1
PHP PHP=5.1.2
PHP PHP=5.1.3
PHP PHP=5.1.4
PHP PHP=5.1.5
PHP PHP=5.1.6
PHP PHP=5.2.0
PHP PHP=5.2.1
PHP PHP=5.2.2
PHP PHP=5.2.3
PHP PHP=5.2.4
PHP PHP=5.2.5
PHP PHP=5.2.6
PHP PHP=5.2.7
PHP PHP=5.2.8
PHP PHP=5.2.9
PHP PHP=5.2.10
PHP PHP=5.2.11
PHP PHP=5.2.12
PHP PHP=5.2.13
PHP PHP=5.2.14
PHP PHP=5.2.15
PHP PHP=5.2.16
PHP PHP=5.2.17
PHP PHP=5.3.0
PHP PHP=5.3.1
PHP PHP=5.3.2
PHP PHP=5.3.3
PHP PHP=5.3.4
PHP PHP=5.3.5
PHP PHP=5.3.6
PHP PHP=5.3.7
PHP PHP=5.3.8
PHP PHP=5.3.9
PHP PHP=5.3.10
PHP PHP=5.4.0
PHP PHP=5.4.1
PHP PHP
PHP PHP<8.3.8
8.3.8
PHP PHP<8.1.29
8.1.29
PHP PHP<5.3.12
PHP PHP>=5.4.0<5.4.2
Fedoraproject Fedora=39
Fedoraproject Fedora=40
Debian Debian Linux=6.0
HP HP-UX=b.11.23
HP HP-UX=b.11.31
openSUSE openSUSE=11.4
openSUSE openSUSE=12.1
SUSE Linux Enterprise Server=10-sp4
SUSE Linux Enterprise Server=11-sp2
SUSE Linux Enterprise Server Vmware=11-sp2
SUSE Linux Enterprise Software Development Kit=10-sp4
SUSE Linux Enterprise Software Development Kit=11-sp2
redhat Application Stack=2.0
redhat Gluster Storage Server For On-premise=2.0
redhat Storage=2.0
redhat Storage For Public Cloud=2.0
redhat Enterprise Linux Desktop=6.0
redhat Enterprise Linux Eus=5.6
redhat Enterprise Linux Eus=6.1
redhat Enterprise Linux Eus=6.2
redhat Enterprise Linux Server=5.0
redhat Enterprise Linux Server=6.0
redhat Enterprise Linux Server Aus=5.3
redhat Enterprise Linux Server Aus=5.6
redhat Enterprise Linux Workstation=5.0
redhat Enterprise Linux Workstation=6.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade PHP to a version that resolves this vulnerability.

    Fixed in 8.3.8
  2. Upgrade

    Upgrade PHP to a version that resolves this vulnerability.

    Fixed in 8.1.29
  3. Upgrade

    Upgrade PHP to a version that resolves this vulnerability.

    Fixed in 5.3.12
  4. Upgrade

    Upgrade PHP to a version that resolves this vulnerability.

    Fixed in 5.4.2
  5. Upgrade

    Upgrade PHP to a version that resolves this vulnerability.

    Patch GHSA-3qgc-jrrr-25jv

Event History

May 11, 2012
CVE Published
via MITRE·10:00 AM
Data Sourced
via MITRE·10:00 AM
Description
Data Sourced
via NVD·10:15 AM
RemedyDescriptionSeverityWeaknessAffected Software
Mar 25, 2022
Known Exploited
via CISA·12:00 AM
Jun 7, 2024
News Published
via BleepingComputer·02:32 PM
News Published
via BleepingComputer·02:34 PM
Aug 20, 2024
News Published
via BleepingComputer·05:49 PM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2012-1823?

CVE-2012-1823 is considered a medium severity vulnerability due to its potential to allow argument injection in PHP-CGI.

2

How do I fix CVE-2012-1823?

To fix CVE-2012-1823, upgrade PHP to version 5.3.12 or later, or 5.4.2 or later.

3

What versions of PHP are affected by CVE-2012-1823?

CVE-2012-1823 affects PHP versions 5.3.11 and earlier, as well as 5.4.1 and earlier.

4

How does CVE-2012-1823 impact PHP CGI configurations?

CVE-2012-1823 impacts PHP CGI configurations by allowing an attacker to bypass security measures through malformed query strings.

5

Is CVE-2012-1823 related to any other vulnerabilities?

CVE-2012-1823 has been linked to CVE-2024-4577, which addresses a bypass of the original issue.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203