GLSA-200703-21 : PHP: Multiple vulnerabilities - Nessus

Critical   Plugin ID: 24887

This page contains detailed information about the GLSA-200703-21 : 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: 24887
Name: GLSA-200703-21 : PHP: Multiple vulnerabilities
Filename: gentoo_GLSA-200703-21.nasl
Vulnerability Published: 2006-11-02
This Plugin Published: 2007-03-26
Last Modification Time: 2021-01-06
Plugin Version: 1.20
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: Critical
Vulnerability Published: 2006-11-02
Patch Published: 2007-03-20
CVE [?]: CVE-2006-5465, CVE-2007-0906, CVE-2007-0907, CVE-2007-0908, CVE-2007-0909, CVE-2007-0910, CVE-2007-0911, CVE-2007-0988, CVE-2007-1286, CVE-2007-1375, CVE-2007-1376, CVE-2007-1380, CVE-2007-1383
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-200703-21 (PHP: Multiple vulnerabilities)

Several vulnerabilities were found in PHP by the Hardened-PHP Project and other researchers. These vulnerabilities include a heap-based buffer overflow in htmlentities() and htmlspecialchars() if called with UTF-8 parameters, and an off-by-one error in str_ireplace(). Other vulnerabilities were also found in the PHP4 branch, including possible overflows, stack corruptions and a format string vulnerability in the *print() functions on 64 bit systems. 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 users should upgrade to the latest version: # emerge --sync # emerge --ask --oneshot --verbose 'dev-lang/php'

Public Exploits


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

Here's the list of publicly known exploits and PoCs for verifying the GLSA-200703-21 : 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)]
  4. GitHub: https://github.com/mudongliang/LinuxFlaw/tree/master/CVE-2006-5465
    [CVE-2006-5465]

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:C/I:C/A:C/E:F/RL:OF/RC:C
CVSS Base Score:10.0 (High)
Impact Subscore:10.0
Exploitability Subscore:10.0
CVSS Temporal Score:8.3 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:8.3 (High)

Go back to menu.

Plugin Source


This is the gentoo_GLSA-200703-21.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 200703-21.
#
# 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(24887);
  script_version("1.20");
  script_set_attribute(attribute:"plugin_modification_date", value:"2021/01/06");

  script_cve_id("CVE-2006-5465", "CVE-2007-0906", "CVE-2007-0907", "CVE-2007-0908", "CVE-2007-0909", "CVE-2007-0910", "CVE-2007-0911", "CVE-2007-0988", "CVE-2007-1286", "CVE-2007-1375", "CVE-2007-1376", "CVE-2007-1380", "CVE-2007-1383");
  script_bugtraq_id(20879, 22496, 22505, 22765, 22805, 22851, 22862);
  script_xref(name:"GLSA", value:"200703-21");

  script_name(english:"GLSA-200703-21 : 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-200703-21
(PHP: Multiple vulnerabilities)

    Several vulnerabilities were found in PHP by the Hardened-PHP Project
    and other researchers. These vulnerabilities include a heap-based
    buffer overflow in htmlentities() and htmlspecialchars() if called with
    UTF-8 parameters, and an off-by-one error in str_ireplace(). Other
    vulnerabilities were also found in the PHP4 branch, including possible
    overflows, stack corruptions and a format string vulnerability in the
    *print() functions on 64 bit systems.
  
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:"http://www.php.net/releases/4_4_5.php"
  );
  script_set_attribute(
    attribute:"see_also",
    value:"http://www.php.net/releases/5_2_1.php"
  );
  script_set_attribute(
    attribute:"see_also",
    value:"https://security.gentoo.org/glsa/200703-21"
  );
  script_set_attribute(
    attribute:"solution", 
    value:
"All PHP users should upgrade to the latest version:
    # emerge --sync
    # emerge --ask --oneshot --verbose 'dev-lang/php'"
  );
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:C/I:C/A:C");
  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, 189, 399);

  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/03/20");
  script_set_attribute(attribute:"plugin_publication_date", value:"2007/03/26");
  script_set_attribute(attribute:"vuln_publication_date", value:"2006/11/02");
  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("ge 5.2.1-r3", "rge 5.1.6-r11", "rge 4.4.6", "rge 4.4.7", "rge 4.4.8_pre20070816"), vulnerable:make_list("lt 5.2.1-r3"))) 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-200703-21.nasl
  • Windows:
    C:\ProgramData\Tenable\Nessus\nessus\plugins\gentoo_GLSA-200703-21.nasl
  • Mac OS X:
    /Library/Nessus/run/lib/nessus/plugins/gentoo_GLSA-200703-21.nasl

Go back to menu.

How to Run


Here is how to run the GLSA-200703-21 : 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-200703-21 : PHP: Multiple vulnerabilities plugin ID 24887.
  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-200703-21.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

/opt/nessus/bin/nasl -a gentoo_GLSA-200703-21.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-200703-21.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-200703-21.nasl -t <IP/HOST>

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: GLSA | Gentoo Linux Security Advisory: CWE | Common Weakness Enumeration:
  • CWE-20 (Weakness) Improper Input Validation
  • CWE-189 (Category) Numeric Errors
  • CWE-399 (Category) Resource Management Errors
See also: Similar and related Nessus plugins:
  • 37281 - CentOS 3 / 4 : php (CESA-2006:0730)
  • 25043 - CentOS 3 / 4 : php (CESA-2007:0155)
  • 23655 - Debian DSA-1206-1 : php4 - several vulnerabilities
  • 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)
  • 25340 - GLSA-200705-19 : PHP: Multiple vulnerabilities
  • 24581 - Mandrake Linux Security Advisory : php (MDKSA-2006:196)
  • 26107 - Mandrake Linux Security Advisory : php (MDKSA-2007:187)
  • 67421 - Oracle Linux 4 : php (ELSA-2006-0730 / ELSA-2006-0669)
  • 67471 - Oracle Linux 3 / 4 : php (ELSA-2007-0155)
  • 24906 - PHP < 4.4.5 Multiple Vulnerabilities
  • 31649 - PHP 5.x < 5.2 Multiple Vulnerabilities
  • 23631 - RHEL 2.1 / 3 / 4 : php (RHSA-2006:0730)
  • 25067 - RHEL 2.1 : php (RHSA-2007:0154)
  • 25068 - RHEL 3 / 4 : php (RHSA-2007:0155)
  • 23653 - Slackware 10.2 / 11.0 : php (SSA:2006-307-01)
  • 29376 - SuSE 10 Security Update : PHP (ZYPP Patch Number 2236)
  • 27148 - openSUSE 10 Security Update : apache2-mod_php5 (apache2-mod_php5-2238)
  • 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)
  • 27956 - Ubuntu 5.10 / 6.06 LTS / 6.10 : php5 vulnerability (USN-375-1)

Version


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

Go back to menu.