7.5
CVSSv2

CVE-2012-2311

Published: 11/05/2012 Updated: 07/11/2023
CVSS v2 Base Score: 7.5 | Impact Score: 6.4 | Exploitability Score: 10
VMScore: 771
Vector: AV:N/AC:L/Au:N/C:P/I:P/A:P

Vulnerability Summary

sapi/cgi/cgi_main.c in PHP prior to 5.3.13 and 5.4.x prior to 5.4.3, when configured as a CGI script (aka php-cgi), does not properly handle query strings that contain a %3D sequence but no = (equals sign) character, which allows remote malicious users 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. NOTE: this vulnerability exists because of an incomplete fix for CVE-2012-1823.

Vulnerability Trend

Vulnerable Product Search on Vulmon Subscribe to Product

php php 4.3.9

php php 4.4.9

php php 3.0

php php 5.2.9

php php 4.0

php php 3.0.5

php php 3.0.11

php php 5.3.10

php php 5.1.5

php php 5.3.6

php php 5.3.9

php php 5.1.2

php php 5.3.1

php php 4.2.0

php php 5.1.1

php php 3.0.1

php php 5.2.14

php php 3.0.2

php php 4.4.4

php php 5.0.0

php php 4.1.0

php php 5.1.6

php php 5.2.16

php php 4.3.4

php php 4.0.4

php php 4.3.0

php php 4.0.5

php php 5.3.8

php php 5.2.7

php php 5.2.2

php php 3.0.8

php php 5.0.5

php php 4.3.6

php php 3.0.13

php php 5.0.1

php php 5.1.4

php php 5.2.5

php php 4.3.7

php php 5.0.4

php php 4.2.2

php php 4.4.2

php php 5.2.12

php php 3.0.7

php php 4.3.2

php php 4.3.11

php php 4.0.0

php php 3.0.6

php php 3.0.17

php php 4.0.7

php php 4.0.2

php php 4.3.3

php php 2.0

php php 4.1.1

php php 3.0.15

php php 3.0.16

php php 5.2.11

php php 5.2.6

php php 5.2.17

php php 5.3.0

php php 4.4.3

php php 5.2.3

php php 5.3.3

php php 5.0.3

php php 3.0.10

php php 5.3.7

php php 3.0.4

php php 4.2.3

php php 5.1.0

php php 4.4.5

php php 5.2.13

php php 2.0b10

php php 4.4.8

php php 4.0.6

php php 5.2.0

php php

php php 5.2.4

php php 5.3.11

php php 4.1.2

php php 5.4.0

php php 5.3.2

php php 5.3.4

php php 4.3.1

php php 5.1.3

php php 3.0.18

php php 4.4.0

php php 5.2.10

php php 4.3.10

php php 4.2.1

php php 4.0.1

php php 1.0

php php 5.0.2

php php 4.4.6

php php 3.0.12

php php 5.4.1

php php 5.2.15

php php 5.3.5

php php 4.4.1

php php 5.2.1

php php 4.0.3

php php 3.0.14

php php 3.0.9

php php 3.0.3

php php 4.3.8

php php 4.3.5

php php 5.2.8

php php 4.4.7

Vendor Advisories

Debian Bug report logs - #671880 php5: PHP-CGI query string parameter vulnerability (CVE-2012-1823 / CVE-2012-2311, CERT VU#520827) Package: php5; Maintainer for php5 is Debian PHP Maintainers <pkg-php-maint@listsaliothdebianorg>; Source for php5 is src:php5 (PTS, buildd, popcon) Reported by: Henri Salo <henri@nervfi& ...
Standalone PHP CGI scripts could be made to execute arbitrary code with the privilege of the web server ...
De Eindbazen discovered that PHP, when run with mod_cgi, will interpret a query string as command line parameters, allowing to execute arbitrary code Additionally, this update fixes insufficient validation of upload name which lead to corrupted $_FILES indices For the stable distribution (squeeze), this problem has been fixed in version 533-7+s ...

Exploits

###################################################################################### # Exploit Title: Cve-2012-1823 PHP CGI Argument Injection Exploit # Date: May 4, 2012 # Author: rayh4c[0x40]80sec[0x2e]com # Exploit Discovered by wofeiwo[0x40]80sec[0x2e]com ###################################################################################### ...
#!/usr/bin/env python # # ap-unlock-v1337py - apache + php 5* rem0te c0de execution exploit # # NOTE: # - quick'n'dirty VERY UGLYY C=000DEEE IZ N0T MY STYLE :((( # - for connect back shell start netcat/nc and bind port on given host:port # - is ip-range scanner not is multithreaded, but iz multithreaded iz in # random scanner and is scann ...
## # $Id$ ## ## # This file is part of the Metasploit Framework and may be subject to # redistribution and commercial restrictions Please see the Metasploit # web site for more information on licensing and terms of use # metasploitcom/ ## require 'msf/core' class Metasploit3 < Msf::Exploit::Remote Rank = ExcellentRanking includ ...
/* Apache Magica by Kingcope */ /* gcc apache-magikac -o apache-magika -lssl */ /* This is a code execution bug in the combination of Apache and PHP On Debian and Ubuntu the vulnerability is present in the default install of the php5-cgi package When the php5-cgi package is installed on Debian and Ubuntu or php-cgi is installed manually the php- ...

Github Repositories

Writeup for the challenges in H@cktivityCon CTF 2020

H@cktivityCon CTF 2020 This is my writeup for the challenges in H@cktivityCon CTF 2020, for more wr

PHP-CGI远程代码执行漏洞(CVE-2012-1823) 原理 参考文章 eindbazennet/2012/05/php-cgi-advisory-cve-2012-1823/ 影响版本 php < 5312 or php < 542 测试环境 编译及运行环境: docker-compose build docker-compose up -d 环境启动后,访问your-ip:8080/可见“Hello”