GLSA-200705-19 : PHP: Multiple vulnerabilities - Nessus

High   Plugin ID: 25340

This page contains detailed information about the GLSA-200705-19 : PHP: Multiple vulnerabilities Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 25340
Name: GLSA-200705-19 : PHP: Multiple vulnerabilities
Filename: gentoo_GLSA-200705-19.nasl
Vulnerability Published: 2007-03-01
This Plugin Published: 2007-05-29
Last Modification Time: 2021-01-06
Plugin Version: 1.18
Plugin Type: local
Plugin Family: Gentoo Local Security Checks
Dependencies: ssh_get_info.nasl
Required KB Items [?]: Host/Gentoo/qpkg-list, Host/Gentoo/release, Host/local_checks_enabled

Vulnerability Information


Severity: High
Vulnerability Published: 2007-03-01
Patch Published: 2007-05-26
CVE [?]: CVE-2007-1001, CVE-2007-1285, CVE-2007-1286, CVE-2007-1484, CVE-2007-1521, CVE-2007-1583, CVE-2007-1700, CVE-2007-1701, CVE-2007-1711, CVE-2007-1717, CVE-2007-1718, CVE-2007-1864, CVE-2007-1900, CVE-2007-2509, CVE-2007-2510, CVE-2007-2511
CPE [?]: cpe:/o:gentoo:linux, p-cpe:/a:gentoo:linux:php

Synopsis

The remote Gentoo host is missing one or more security-related patches.

Description

The remote host is affected by the vulnerability described in GLSA-200705-19 (PHP: Multiple vulnerabilities)

Several vulnerabilities were found in PHP, most of them during the Month Of PHP Bugs (MOPB) by Stefan Esser. The most severe of these vulnerabilities are integer overflows in wbmp.c from the GD library (CVE-2007-1001) and in the substr_compare() PHP 5 function (CVE-2007-1375). Ilia Alshanetsky also reported a buffer overflow in the make_http_soap_request() and in the user_filter_factory_create() functions (CVE-2007-2510, CVE-2007-2511), and Stanislav Malyshev discovered another buffer overflow in the bundled XMLRPC library (CVE-2007-1864). Additionally, the session_regenerate_id() and the array_user_key_compare() functions contain a double-free vulnerability (CVE-2007-1484, CVE-2007-1521). Finally, there exist implementation errors in the Zend engine, in the mb_parse_str(), the unserialize() and the mail() functions and other elements. Impact :

Remote attackers might be able to exploit these issues in PHP applications making use of the affected functions, potentially resulting in the execution of arbitrary code, Denial of Service, execution of scripted contents in the context of the affected site, security bypass or information leak. Workaround :

There is no known workaround at this time.

Solution

All PHP 5 users should upgrade to the latest version: # emerge --sync # emerge --ask --oneshot --verbose '>=dev-lang/php-5.2.2' All PHP 4 users should upgrade to the latest version: # emerge --sync # emerge --ask --oneshot --verbose '>=dev-lang/php-4.4.7'

Public Exploits


Target Network Port(s): N/A
Target Asset(s): N/A
Exploit Available: True (Metasploit Framework, Exploit-DB)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the GLSA-200705-19 : PHP: Multiple vulnerabilities vulnerability:

  1. Metasploit: exploit/multi/php/php_unserialize_zval_cookie
    [PHP 4 unserialize() ZVAL Reference Counter Overflow (Cookie)]
  2. Exploit-DB: exploits/php/remote/9939.rb
    [EDB-9939: PHP < 4.5.0 - Unserialize Overflow (Metasploit)]
  3. Exploit-DB: exploits/multiple/remote/16310.rb
    [EDB-16310: PHP 4 - Unserialize() ZVAL Reference Counter Overflow (Cookie) (Metasploit)]

Before running any exploit against any system, make sure you are authorized by the owner of the target system(s) to perform such activity. In any other case, this would be considered as an illegal activity.

WARNING: Beware of using unverified exploits from sources such as GitHub or Exploit-DB. These exploits and PoCs could contain malware. For more information, see how to use exploits safely.

Risk Information


CVSS V2 Vector [?]: AV:N/AC:L/Au:N/C:N/I:C/A:N/E:F/RL:OF/RC:C
CVSS Base Score:7.8 (High)
Impact Subscore:6.9
Exploitability Subscore:10.0
CVSS Temporal Score:6.4 (Medium)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:6.4 (Medium)

Go back to menu.

Plugin Source


This is the gentoo_GLSA-200705-19.nasl nessus plugin source code. This script is Copyright (C) 2007-2021 Tenable Network Security, Inc.

#%NASL_MIN_LEVEL 70300
#
# (C) Tenable Network Security, Inc.
#
# The descriptive text and package checks in this plugin were
# extracted from Gentoo Linux Security Advisory GLSA 200705-19.
#
# The advisory text is Copyright (C) 2001-2016 Gentoo Foundation, Inc.
# and licensed under the Creative Commons - Attribution / Share Alike 
# license. See http://creativecommons.org/licenses/by-sa/3.0/
#

include('deprecated_nasl_level.inc');
include('compat.inc');

if (description)
{
  script_id(25340);
  script_version("1.18");
  script_set_attribute(attribute:"plugin_modification_date", value:"2021/01/06");

  script_cve_id("CVE-2007-1001", "CVE-2007-1285", "CVE-2007-1286", "CVE-2007-1484", "CVE-2007-1521", "CVE-2007-1583", "CVE-2007-1700", "CVE-2007-1701", "CVE-2007-1711", "CVE-2007-1717", "CVE-2007-1718", "CVE-2007-1864", "CVE-2007-1900", "CVE-2007-2509", "CVE-2007-2510", "CVE-2007-2511");
  script_xref(name:"GLSA", value:"200705-19");

  script_name(english:"GLSA-200705-19 : PHP: Multiple vulnerabilities");
  script_summary(english:"Checks for updated package(s) in /var/db/pkg");

  script_set_attribute(
    attribute:"synopsis", 
    value:
"The remote Gentoo host is missing one or more security-related
patches."
  );
  script_set_attribute(
    attribute:"description", 
    value:
"The remote host is affected by the vulnerability described in GLSA-200705-19
(PHP: Multiple vulnerabilities)

    Several vulnerabilities were found in PHP, most of them during the
    Month Of PHP Bugs (MOPB) by Stefan Esser. The most severe of these
    vulnerabilities are integer overflows in wbmp.c from the GD library
    (CVE-2007-1001) and in the substr_compare() PHP 5 function
    (CVE-2007-1375). Ilia Alshanetsky also reported a buffer overflow in
    the make_http_soap_request() and in the user_filter_factory_create()
    functions (CVE-2007-2510, CVE-2007-2511), and Stanislav Malyshev
    discovered another buffer overflow in the bundled XMLRPC library
    (CVE-2007-1864). Additionally, the session_regenerate_id() and the
    array_user_key_compare() functions contain a double-free vulnerability
    (CVE-2007-1484, CVE-2007-1521). Finally, there exist implementation
    errors in the Zend engine, in the mb_parse_str(), the unserialize() and
    the mail() functions and other elements.
  
Impact :

    Remote attackers might be able to exploit these issues in PHP
    applications making use of the affected functions, potentially
    resulting in the execution of arbitrary code, Denial of Service,
    execution of scripted contents in the context of the affected site,
    security bypass or information leak.
  
Workaround :

    There is no known workaround at this time."
  );
  script_set_attribute(
    attribute:"see_also",
    value:"https://security.gentoo.org/glsa/200705-19"
  );
  script_set_attribute(
    attribute:"solution", 
    value:
"All PHP 5 users should upgrade to the latest version:
    # emerge --sync
    # emerge --ask --oneshot --verbose '>=dev-lang/php-5.2.2'
    All PHP 4 users should upgrade to the latest version:
    # emerge --sync
    # emerge --ask --oneshot --verbose '>=dev-lang/php-4.4.7'"
  );
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:N/I:C/A:N");
  script_set_cvss_temporal_vector("CVSS2#E:F/RL:OF/RC:C");
  script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"true");
  script_set_attribute(attribute:"metasploit_name", value:'PHP 4 unserialize() ZVAL Reference Counter Overflow (Cookie)');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
  script_cwe_id(20, 119);

  script_set_attribute(attribute:"plugin_type", value:"local");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:gentoo:linux:php");
  script_set_attribute(attribute:"cpe", value:"cpe:/o:gentoo:linux");

  script_set_attribute(attribute:"patch_publication_date", value:"2007/05/26");
  script_set_attribute(attribute:"plugin_publication_date", value:"2007/05/29");
  script_set_attribute(attribute:"vuln_publication_date", value:"2007/03/01");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_copyright(english:"This script is Copyright (C) 2007-2021 Tenable Network Security, Inc.");
  script_family(english:"Gentoo Local Security Checks");

  script_dependencies("ssh_get_info.nasl");
  script_require_keys("Host/local_checks_enabled", "Host/Gentoo/release", "Host/Gentoo/qpkg-list");

  exit(0);
}


include("audit.inc");
include("global_settings.inc");
include("qpkg.inc");

if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
if (!get_kb_item("Host/Gentoo/release")) audit(AUDIT_OS_NOT, "Gentoo");
if (!get_kb_item("Host/Gentoo/qpkg-list")) audit(AUDIT_PACKAGE_LIST_MISSING);


flag = 0;

if (qpkg_check(package:"dev-lang/php", unaffected:make_list("rge 4.4.7", "rge 4.4.8_pre20070816", "ge 5.2.2"), vulnerable:make_list("lt 5.2.2"))) flag++;

if (flag)
{
  if (report_verbosity > 0) security_hole(port:0, extra:qpkg_report_get());
  else security_hole(0);
  exit(0);
}
else
{
  tested = qpkg_tests_get();
  if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
  else audit(AUDIT_PACKAGE_NOT_INSTALLED, "PHP");
}

The latest version of this script can be found in these locations depending on your platform:

  • Linux / Unix:
    /opt/nessus/lib/nessus/plugins/gentoo_GLSA-200705-19.nasl
  • Windows:
    C:\ProgramData\Tenable\Nessus\nessus\plugins\gentoo_GLSA-200705-19.nasl
  • Mac OS X:
    /Library/Nessus/run/lib/nessus/plugins/gentoo_GLSA-200705-19.nasl

Go back to menu.

How to Run


Here is how to run the GLSA-200705-19 : PHP: Multiple vulnerabilities as a standalone plugin via the Nessus web user interface (https://localhost:8834/):

  1. Click to start a New Scan.
  2. Select Advanced Scan.
  3. Navigate to the Plugins tab.
  4. On the top right corner click to Disable All plugins.
  5. On the left side table select Gentoo Local Security Checks plugin family.
  6. On the right side table select GLSA-200705-19 : PHP: Multiple vulnerabilities plugin ID 25340.
  7. Specify the target on the Settings tab and click to Save the scan.
  8. Run the scan.

Here are a few examples of how to run the plugin in the command line. Note that the examples below demonstrate the usage on the Linux / Unix platform.

Basic usage:

/opt/nessus/bin/nasl gentoo_GLSA-200705-19.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

/opt/nessus/bin/nasl -a gentoo_GLSA-200705-19.nasl -t <IP/HOST>

Run the plugin with trace script execution written to the console (useful for debugging):

/opt/nessus/bin/nasl -T - gentoo_GLSA-200705-19.nasl -t <IP/HOST>

Run the plugin with using a state file for the target and updating it (useful for running multiple plugins on the target):

/opt/nessus/bin/nasl -K /tmp/state gentoo_GLSA-200705-19.nasl -t <IP/HOST>

Go back to menu.

References


GLSA | Gentoo Linux Security Advisory: CWE | Common Weakness Enumeration:
  • CWE-20 (Weakness) Improper Input Validation
  • CWE-119 (Weakness) Improper Restriction of Operations within the Bounds of a Memory Buffer
See also: Similar and related Nessus plugins:
  • 25043 - CentOS 3 / 4 : php (CESA-2007:0155)
  • 26204 - CentOS 3 : php (CESA-2007:0889)
  • 25099 - Debian DSA-1282-1 : php4 - several vulnerabilities
  • 25100 - Debian DSA-1283-1 : php5 - several vulnerabilities
  • 78215 - F5 Networks BIG-IP : Multiple PHP vulnerabilities (SOL7859)
  • 27759 - Fedora 7 : php-5.2.4-1.fc7 (2007-2215)
  • 24887 - GLSA-200703-21 : PHP: Multiple vulnerabilities
  • 26942 - GLSA-200710-02 : PHP: Multiple vulnerabilities
  • 25830 - Mac OS X Multiple Vulnerabilities (Security Update 2007-007)
  • 26107 - Mandrake Linux Security Advisory : php (MDKSA-2007:187)
  • 67471 - Oracle Linux 3 / 4 : php (ELSA-2007-0155)
  • 67569 - Oracle Linux 3 : php (ELSA-2007-0889)
  • 24906 - PHP < 4.4.5 Multiple Vulnerabilities
  • 25368 - PHP < 5.2.3 Multiple Vulnerabilities
  • 25067 - RHEL 2.1 : php (RHSA-2007:0154)
  • 25068 - RHEL 3 / 4 : php (RHSA-2007:0155)
  • 27564 - RHEL 2.1 : php (RHSA-2007:0888)
  • 26191 - RHEL 3 : php (RHSA-2007:0889)
  • 60257 - Scientific Linux Security Update : php on SL3.x i386/x86_64
  • 25373 - Slackware 10.2 / 11.0 / current : php5 (SSA:2007-152-01)
  • 31101 - Slackware 10.2 / 11.0 : php (SSA:2008-045-03)
  • 27391 - openSUSE 10 Security Update : php5 (php5-3745)
  • 27392 - openSUSE 10 Security Update : php5 (php5-3753)
  • 29552 - SuSE 10 Security Update : PHP5 (ZYPP Patch Number 3754)
  • 28372 - Ubuntu 6.06 LTS / 6.10 / 7.04 / 7.10 : php5 vulnerabilities (USN-549-1)
  • 29213 - Ubuntu 7.10 : php5 regression (USN-549-2)

Version


This page has been produced using Nessus Professional 10.1.2 (#68) LINUX, Plugin set 202205072148.
Plugin file gentoo_GLSA-200705-19.nasl version 1.18. For more plugins, visit the Nessus Plugin Library.

Go back to menu.