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.
Published 2012-05-11 10:15:48
Updated 2025-01-06 19:21:39
Source CERT/CC
View at NVD,   CVE.org
Vulnerability category: Execute code

Products affected by CVE-2012-1823

Threat overview for CVE-2012-1823

Top countries where our scanners detected CVE-2012-1823
Top open port discovered on systems with this issue 80
IPs affected by CVE-2012-1823 205,048
Threat actors abusing to this issue? Yes
Find out if you* are affected by CVE-2012-1823!
*Directly or indirectly through your vendors, service providers and 3rd parties. Powered by attack surface intelligence from SecurityScorecard.

CVE-2012-1823 is in the CISA Known Exploited Vulnerabilities Catalog

CISA vulnerability name:
PHP-CGI Query String Parameter Vulnerability
CISA required action:
Apply updates per vendor instructions.
CISA description:
sapi/cgi/cgi_main.c in PHP, when configured as a CGI script, does not properly handle query strings, which allows remote attackers to execute arbitrary code.
Notes:
https://nvd.nist.gov/vuln/detail/CVE-2012-1823
Added on 2022-03-25 Action due date 2022-04-15

Exploit prediction scoring system (EPSS) score for CVE-2012-1823

95.70%
Probability of exploitation activity in the next 30 days EPSS Score History
~ 100 %
Percentile, the proportion of vulnerabilities that are scored at or less

Metasploit modules for CVE-2012-1823

  • PHP CGI Argument Injection
    Disclosure Date: 2012-05-03
    First seen: 2020-04-26
    exploit/multi/http/php_cgi_arg_injection
    When run as a CGI, PHP up to version 5.3.12 and 5.4.2 is vulnerable to an argument injection vulnerability. This module takes advantage of the -d flag to set php.ini directives to achieve code execution. From the advisory: "if there is NO unescaped '=' in t

CVSS scores for CVE-2012-1823

Base Score Base Severity CVSS Vector Exploitability Score Impact Score Score Source First Seen
7.5
HIGH AV:N/AC:L/Au:N/C:P/I:P/A:P
10.0
6.4
NIST
9.8
CRITICAL CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
3.9
5.9
NIST 2024-07-16

CWE ids for CVE-2012-1823

  • The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
    Assigned by: nvd@nist.gov (Primary)
  • The product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component.
    Assigned by: nvd@nist.gov (Primary)

References for CVE-2012-1823

Jump to
This web site uses cookies for managing your session, storing preferences, website analytics and additional purposes described in our privacy policy.
By using this web site you are agreeing to CVEdetails.com terms of use!