###############################################################################
# OpenVAS Vulnerability Test
# $Id: secpod_ibm_udb_db2_mult_vuln_lin.nasl 6252 2009-12-21 24:11:27Z dec $
#
# IBM DB2 UDB Multiple Unspecified Vulnerabilities (Linux)
#
# Authors:
# Antu Sanadi <santu@secpod.com>
#
# Updated By:
# Antu Sanadi <santu@secpod.com> on 2009/12/29 #6444
#
# Copyright:
# Copyright (c) 2009 SecPod, http://www.secpod.com
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2
# (or any later version), as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
###############################################################################

if(description)
{
  script_id(901083);
  script_version("$Revision: 8288 $: 1.1");
  script_tag(name:"cvss_base", value:"10.0");
  script_tag(name:"risk_factor", value:"Critical");
  script_cve_id("CVE-2009-4328", "CVE-2009-4329", "CVE-2009-4330", "CVE-2009-4333",
                "CVE-2009-4335", "CVE-2009-4439");
  script_bugtraq_id(37332);
  script_name("IBM DB2 UDB Multiple Unspecified Vulnerabilities (Linux)");
  desc = "
  Overview: The host is installed with IBM DB2 and is prone to multiple
  vulnerabilities.

  Vulnerability Insight:
  The flaws are caused due to:
  - An unspecified error in the Engine Utilities component, causes segmentation
    fault by modifying the db2ra data stream sent in a request from the load
    utility.
  - An unspecified error in 'db2licm' within the Engine Utilities component it
    has unknown impact and local attack vectors.
  - An unspecified error in the DRDA Services componenta, causes the server trap
    by calling a SQL stored procedure in unknown circumstances.
  - An error in relational data services component, allows attackers to obtain
    the password argument from the SET ENCRYPTION PASSWORD statement via vectors
    involving the GET SNAPSHOT FOR DYNAMIC SQL command.
  - Multiple unspecified errors in bundled stored procedures in the Spatial
    Extender component, have unknown impact and remote attack vectors.
  - An unspecified vulnerability in the Query Compiler, Rewrite, and Optimizer
    component, allows to cause a denial of service (instance crash) by compiling
    a SQL query

  Impact:
  Successful exploitation will let the attacker to bypass security restrictions,
  cause a denial of service.

  Impact Level: System/Application

  Affected Software/OS:
  IBM DB2 version 9.5 prior to Fixpak 5

  Fix:
  Update IBM DB2 9.5 Fixpak 5,
  http://www-01.ibm.com/support/docview.wss?rs=0&uid=swg24022678

  References:
  http://secunia.com/advisories/37759
  http://www.vupen.com/english/advisories/2009/3520
  ftp://ftp.software.ibm.com/ps/products/db2/fixes/english-us/aparlist/db2_v95/APARLIST.TXT

  CVSS Score:
    CVSS Base Score      : 10.0 (AV:N/AC:L/Au:NR/C:C/I:C/A:C)
    CVSS Temporal Score  : 7.4
  Risk factor: High";

  script_description(desc);
  script_summary("Check for the version of IBM DB2 ");
  script_category(ACT_GATHER_INFO);
  script_copyright("Copyright (C) 2009 SecPod");
  script_family("Databases");
  script_dependencies("secpod_ibm_db2_detect_linux_900217.nasl");
  script_require_keys("Linux/IBM_db2/Ver");
  exit(0);
}


include("version_func.inc");

ibmVer = get_kb_item("Linux/IBM_db2/Ver");
if(!ibmVer){
  exit(0);
}

# Check for IBM DB2 Products Version 9.5 before 9.5 FP5 (9.5 FP 5 = 9.5.0.5)
if(version_in_range(version:ibmVer, test_version:"9.5", test_version2:"9.5.0.4")){
  security_hole(0);
}
