Vulnerabilities > CVE-2012-2335 - Permissions, Privileges, and Access Controls vulnerability in PHP 5.3.12/5.4.2

047910
CVSS 0.0 - NONE
Attack vector
UNKNOWN
Attack complexity
UNKNOWN
Privileges required
UNKNOWN
Confidentiality impact
UNKNOWN
Integrity impact
UNKNOWN
Availability impact
UNKNOWN
php
CWE-264
nessus

Summary

php-wrapper.fcgi does not properly handle command-line arguments, which allows remote attackers to bypass a protection mechanism in PHP 5.3.12 and 5.4.2 and execute arbitrary code by leveraging improper interaction between the PHP sapi/cgi/cgi_main.c component and a query string beginning with a +- sequence.

Vulnerable Configurations

Part Description Count
Application
Php
2

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Accessing, Modifying or Executing Executable Files
    An attack of this type exploits a system's configuration that allows an attacker to either directly access an executable file, for example through shell access; or in a possible worst case allows an attacker to upload a file and then execute it. Web servers, ftp servers, and message oriented middleware systems which have many integration points are particularly vulnerable, because both the programmers and the administrators must be in synch regarding the interfaces and the correct privileges for each interface.
  • Leverage Executable Code in Non-Executable Files
    An attack of this type exploits a system's trust in configuration and resource files, when the executable loads the resource (such as an image file or configuration file) the attacker has modified the file to either execute malicious code directly or manipulate the target process (e.g. application server) to execute based on the malicious configuration parameters. Since systems are increasingly interrelated mashing up resources from local and remote sources the possibility of this attack occurring is high. The attack can be directed at a client system, such as causing buffer overrun through loading seemingly benign image files, as in Microsoft Security Bulletin MS04-028 where specially crafted JPEG files could cause a buffer overrun once loaded into the browser. Another example targets clients reading pdf files. In this case the attacker simply appends javascript to the end of a legitimate url for a pdf (http://www.gnucitizen.org/blog/danger-danger-danger/) http://path/to/pdf/file.pdf#whatever_name_you_want=javascript:your_code_here The client assumes that they are reading a pdf, but the attacker has modified the resource and loaded executable javascript into the client's browser process. The attack can also target server processes. The attacker edits the resource or configuration file, for example a web.xml file used to configure security permissions for a J2EE app server, adding role name "public" grants all users with the public role the ability to use the administration functionality. The server trusts its configuration file to be correct, but when they are manipulated, the attacker gains full control.
  • Blue Boxing
    This type of attack against older telephone switches and trunks has been around for decades. A tone is sent by an adversary to impersonate a supervisor signal which has the effect of rerouting or usurping command of the line. While the US infrastructure proper may not contain widespread vulnerabilities to this type of attack, many companies are connected globally through call centers and business process outsourcing. These international systems may be operated in countries which have not upgraded Telco infrastructure and so are vulnerable to Blue boxing. Blue boxing is a result of failure on the part of the system to enforce strong authorization for administrative functions. While the infrastructure is different than standard current applications like web applications, there are historical lessons to be learned to upgrade the access control for administrative functions.
  • Restful Privilege Elevation
    Rest uses standard HTTP (Get, Put, Delete) style permissions methods, but these are not necessarily correlated generally with back end programs. Strict interpretation of HTTP get methods means that these HTTP Get services should not be used to delete information on the server, but there is no access control mechanism to back up this logic. This means that unless the services are properly ACL'd and the application's service implementation are following these guidelines then an HTTP request can easily execute a delete or update on the server side. The attacker identifies a HTTP Get URL such as http://victimsite/updateOrder, which calls out to a program to update orders on a database or other resource. The URL is not idempotent so the request can be submitted multiple times by the attacker, additionally, the attacker may be able to exploit the URL published as a Get method that actually performs updates (instead of merely retrieving data). This may result in malicious or inadvertent altering of data on the server.
  • Target Programs with Elevated Privileges
    This attack targets programs running with elevated privileges. The attacker would try to leverage a bug in the running program and get arbitrary code to execute with elevated privileges. For instance an attacker would look for programs that write to the system directories or registry keys (such as HKLM, which stores a number of critical Windows environment variables). These programs are typically running with elevated privileges and have usually not been designed with security in mind. Such programs are excellent exploit targets because they yield lots of power when they break. The malicious user try to execute its code at the same level as a privileged system call.

Nessus

  • NASL familySuSE Local Security Checks
    NASL idSUSE_APACHE2-MOD_PHP5-8133.NASL
    descriptionPHP5 was updated with incremental fixes to the previous update : - Additional unsafe cgi wrapper scripts are also fixed now. (CVE-2012-2335) - Even more commandline option handling is filtered, which could lead to crashes of the php interpreter. (CVE-2012-2336)
    last seen2020-06-05
    modified2012-06-11
    plugin id59445
    published2012-06-11
    reporterThis script is Copyright (C) 2012-2020 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/59445
    titleSuSE 10 Security Update : PHP5 (ZYPP Patch Number 8133)
    code
    #%NASL_MIN_LEVEL 80502
    #
    # (C) Tenable Network Security, Inc.
    #
    # The text description of this plugin is (C) Novell, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(59445);
      script_version("1.2");
      script_set_attribute(attribute:"plugin_modification_date", value:"2020/06/04");
    
      script_cve_id("CVE-2012-2335", "CVE-2012-2336");
    
      script_name(english:"SuSE 10 Security Update : PHP5 (ZYPP Patch Number 8133)");
      script_summary(english:"Checks rpm output for the updated packages");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote SuSE 10 host is missing a security-related patch."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "PHP5 was updated with incremental fixes to the previous update :
    
      - Additional unsafe cgi wrapper scripts are also fixed
        now. (CVE-2012-2335)
    
      - Even more commandline option handling is filtered, which
        could lead to crashes of the php interpreter.
        (CVE-2012-2336)"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"http://support.novell.com/security/cve/CVE-2012-2335.html"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"http://support.novell.com/security/cve/CVE-2012-2336.html"
      );
      script_set_attribute(attribute:"solution", value:"Apply ZYPP patch number 8133.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:P");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:suse:suse_linux");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2012/05/18");
      script_set_attribute(attribute:"plugin_publication_date", value:"2012/06/11");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2012-2020 Tenable Network Security, Inc.");
      script_family(english:"SuSE Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/cpu", "Host/SuSE/release", "Host/SuSE/rpm-list");
    
      exit(0);
    }
    
    
    include("global_settings.inc");
    include("rpm.inc");
    
    
    if (!get_kb_item("Host/local_checks_enabled")) exit(0, "Local checks are not enabled.");
    if (!get_kb_item("Host/SuSE/release")) exit(0, "The host is not running SuSE.");
    if (!get_kb_item("Host/SuSE/rpm-list")) exit(1, "Could not obtain the list of installed packages.");
    
    cpu = get_kb_item("Host/cpu");
    if (isnull(cpu)) exit(1, "Failed to determine the architecture type.");
    if (cpu >!< "x86_64" && cpu !~ "^i[3-6]86$") exit(1, "Local checks for SuSE 10 on the '"+cpu+"' architecture have not been implemented.");
    
    
    flag = 0;
    if (rpm_check(release:"SLES10", sp:4, reference:"apache2-mod_php5-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-bcmath-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-bz2-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-calendar-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-ctype-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-curl-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-dba-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-dbase-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-devel-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-dom-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-exif-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-fastcgi-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-ftp-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-gd-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-gettext-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-gmp-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-hash-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-iconv-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-imap-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-json-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-ldap-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-mbstring-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-mcrypt-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-mhash-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-mysql-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-ncurses-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-odbc-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-openssl-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-pcntl-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-pdo-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-pear-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-pgsql-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-posix-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-pspell-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-shmop-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-snmp-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-soap-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-sockets-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-sqlite-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-suhosin-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-sysvmsg-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-sysvsem-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-sysvshm-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-tokenizer-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-wddx-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-xmlreader-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-xmlrpc-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-xsl-5.2.14-0.34.1")) flag++;
    if (rpm_check(release:"SLES10", sp:4, reference:"php5-zlib-5.2.14-0.34.1")) flag++;
    
    
    if (flag)
    {
      if (report_verbosity > 0) security_hole(port:0, extra:rpm_report_get());
      else security_hole(0);
      exit(0);
    }
    else exit(0, "The host is not affected.");
    
  • NASL familySuSE Local Security Checks
    NASL idSUSE_11_APACHE2-MOD_PHP5-120518.NASL
    descriptionPHP5 was updated with incremental fixes to the previous update : - Additional unsafe cgi wrapper scripts are also fixed now. (CVE-2012-2335) - Even more commandline option handling is filtered, which could lead to crashes of the php interpreter. (CVE-2012-2336)
    last seen2020-06-05
    modified2013-01-25
    plugin id64100
    published2013-01-25
    reporterThis script is Copyright (C) 2013-2020 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/64100
    titleSuSE 11.1 Security Update : PHP5 (SAT Patch Number 6316)
  • NASL familySuSE Local Security Checks
    NASL idSUSE_11_APACHE2-MOD_PHP53-120618.NASL
    descriptionPHP5 was updated with incremental fixes to the previous update. - Additional unsafe cgi wrapper scripts are also fixed now. (CVE-2012-2335) - Even more commandline option handling is filtered, which could lead to crashes of the php interpreter. (CVE-2012-2336) - heap-based buffer overflow in php
    last seen2020-06-05
    modified2013-01-25
    plugin id64104
    published2013-01-25
    reporterThis script is Copyright (C) 2013-2020 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/64104
    titleSuSE 11.2 Security Update : PHP5 (SAT Patch Number 6440)
  • NASL familyGentoo Local Security Checks
    NASL idGENTOO_GLSA-201209-03.NASL
    descriptionThe remote host is affected by the vulnerability described in GLSA-201209-03 (PHP: Multiple vulnerabilities) Multiple vulnerabilities have been discovered in PHP. Please review the CVE identifiers referenced below for details. Impact : A remote attacker could execute arbitrary code with the privileges of the process, cause a Denial of Service condition, obtain sensitive information, create arbitrary files, conduct directory traversal attacks, bypass protection mechanisms, or perform further attacks with unspecified impact. Workaround : There is no known workaround at this time.
    last seen2020-06-01
    modified2020-06-02
    plugin id62236
    published2012-09-24
    reporterThis script is Copyright (C) 2012-2018 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/62236
    titleGLSA-201209-03 : PHP: Multiple vulnerabilities
  • NASL familyUbuntu Local Security Checks
    NASL idUBUNTU_USN-1481-1.NASL
    descriptionIt was discovered that PHP incorrectly handled certain Tidy::diagnose operations on invalid objects. A remote attacker could use this flaw to cause PHP to crash, leading to a denial of service. (CVE-2012-0781) It was discovered that PHP incorrectly handled certain multi-file upload filenames. A remote attacker could use this flaw to cause a denial of service, or to perform a directory traversal attack. (CVE-2012-1172) Rubin Xu and Joseph Bonneau discovered that PHP incorrectly handled certain Unicode characters in passwords passed to the crypt() function. A remote attacker could possibly use this flaw to bypass authentication. (CVE-2012-2143) It was discovered that a Debian/Ubuntu specific patch caused PHP to incorrectly handle empty salt strings. A remote attacker could possibly use this flaw to bypass authentication. This issue only affected Ubuntu 10.04 LTS and Ubuntu 11.04. (CVE-2012-2317) It was discovered that PHP, when used as a stand alone CGI processor for the Apache Web Server, did not properly parse and filter query strings. This could allow a remote attacker to execute arbitrary code running with the privilege of the web server, or to perform a denial of service. Configurations using mod_php5 and FastCGI were not vulnerable. (CVE-2012-2335, CVE-2012-2336) Alexander Gavrun discovered that the PHP Phar extension incorrectly handled certain malformed TAR files. A remote attacker could use this flaw to perform a denial of service, or possibly execute arbitrary code. (CVE-2012-2386). Note that Tenable Network Security has extracted the preceding description block directly from the Ubuntu security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen2020-06-01
    modified2020-06-02
    plugin id59603
    published2012-06-20
    reporterUbuntu Security Notice (C) 2012-2019 Canonical, Inc. / NASL script (C) 2012-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/59603
    titleUbuntu 8.04 LTS / 10.04 LTS / 11.04 / 11.10 / 12.04 LTS : php5 vulnerabilities (USN-1481-1)
  • NASL familyWeb Servers
    NASL idHPSMH_7_2_1_0.NASL
    descriptionAccording to the web server
    last seen2020-06-01
    modified2020-06-02
    plugin id69020
    published2013-07-23
    reporterThis script is Copyright (C) 2013-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/69020
    titleHP System Management Homepage < 7.2.1.0 Multiple Vulnerabilities (BEAST)
  • NASL familySuSE Local Security Checks
    NASL idOPENSUSE-2012-288.NASL
    descriptionThe patch for CVE-2012-1823 was incomplete, this update fixes the remaining bits (CVE-2012-2335, CVE-2012-2336)
    last seen2020-06-05
    modified2014-06-13
    plugin id74630
    published2014-06-13
    reporterThis script is Copyright (C) 2014-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/74630
    titleopenSUSE Security Update : php5 (openSUSE-2012-288)
  • NASL familyCGI abuses
    NASL idPHP_5_4_3.NASL
    descriptionAccording to its banner, the version of PHP installed on the remote host is 5.4.x earlier than 5.4.3. It is, therefore, potentially affected the following vulnerabilities : - The fix for CVE-2012-1823 does not completely correct the CGI query parameter vulnerability. Disclosure of PHP source code and code execution are still possible. Note that this vulnerability is exploitable only when PHP is used in CGI-based configurations. Apache with
    last seen2020-06-01
    modified2020-06-02
    plugin id59057
    published2012-05-09
    reporterThis script is Copyright (C) 2012-2018 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/59057
    titlePHP 5.4.x < 5.4.3 Multiple Vulnerabilities
  • NASL familyCGI abuses
    NASL idPHP_CGI_REMOTE_CODE_EXECUTION.NASL
    descriptionThe PHP installation on the remote web server contains a flaw that could allow a remote attacker to pass command-line arguments as part of a query string to the PHP-CGI program. This could be abused to execute arbitrary code, reveal PHP source code, cause a system crash, etc.
    last seen2020-06-01
    modified2020-06-02
    plugin id70728
    published2013-11-01
    reporterThis script is Copyright (C) 2013-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/70728
    titleApache PHP-CGI Remote Code Execution
  • NASL familyMandriva Local Security Checks
    NASL idMANDRIVA_MDVSA-2012-068.NASL
    descriptionA vulnerability has been found and corrected in php(-cgi) : PHP-CGI-based setups contain a vulnerability when parsing query string parameters from php files. A remote unauthenticated attacker could obtain sensitive information, cause a denial of service condition or may be able to execute arbitrary code with the privileges of the web server (CVE-2012-1823). The updated packages have been patched to correct this issue. Update : It was discovered that the previous fix for the CVE-2012-1823 vulnerability was incomplete (CVE-2012-2335, CVE-2012-2336). The updated packages provides the latest version (5.3.13) which provides a solution to this flaw.
    last seen2020-06-01
    modified2020-06-02
    plugin id59010
    published2012-05-07
    reporterThis script is Copyright (C) 2012-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/59010
    titleMandriva Linux Security Advisory : php (MDVSA-2012:068-1)
  • NASL familyCGI abuses
    NASL idPHP_5_3_13.NASL
    descriptionAccording to its banner, the version of PHP installed on the remote host is 5.3.x earlier than 5.3.13 and, as such, is potentially affected by a remote code execution and information disclosure vulnerability. The fix for CVE-2012-1823 does not completely correct the CGI query vulnerability. Disclosure of PHP source code and code execution via query parameters are still possible. Note that this vulnerability is exploitable only when PHP is used in CGI-based configurations. Apache with
    last seen2020-06-01
    modified2020-06-02
    plugin id59056
    published2012-05-09
    reporterThis script is Copyright (C) 2012-2018 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/59056
    titlePHP 5.3.x < 5.3.13 CGI Query String Code Execution