Cisco IOS Software IKEv1 State Machine DoS (CSCuw08236)

2016-01-08T00:00:00
ID CISCO-SN-CSCUW08236-IOS.NASL
Type nessus
Reporter Tenable
Modified 2018-08-09T00:00:00

Description

According to its self-reported version, the Cisco IOS software running on the remote device is affected by a denial of service vulnerability in the Internet Key Exchange version 1 (IKEv1) subsystem due to insufficient condition checks in the IKEv1 state machine. An unauthenticated, remote attacker can exploit this vulnerability, by sending a spoofed, specific IKEv1 packet to an endpoint of an IPsec tunnel, to tear down IPsec tunnels that terminate on the endpoint, resulting in a partial denial of service condition.

                                        
                                            #TRUSTED 96d9be4aa6545c605fd7a8934ebbdd021934af331e4940c0874ff314f212859cf01ebfad6468c801a20b0dd82ca396a788e91cef5bf3d53124be80de65c5d03e370da1a23099cb3edeb48d9ae2bb40ec3c15190fe8a03d701b2d36faa955b5bcd02ab583568eafebea807ff0db02478e64bd339ce1ae78145ef029dd231397fdf6d3dfa0b5e9a53f554c3bcd22201881b148fc1454625c09d23d46b6402e2709862a7e6dfd3d02ebb6eb197fcdbfc8fb524769f553a9fd02cd37245bd1735349617d2c49ea61b1ab19d9295b420d6f16541c3cd946a9fd56cd7774d11b0e2bd9576c3e221f09327567523ba6eb89895d116671e173544390c650214af2a08afb6e753502f4b3a40a298243bb7cd462fa385bc9f1d3b8e29678376962db7233c9ef8c0758faeadbdda87e0b09dcc9288e1eb3709c6c28b354bb17a1e7cb4e1261ac1bed9e854359f8941003dcaea4b7f458a8f260b2b17142066713ad62b393d1d3657f80b69e8ea40d2b724bc128131112edaa8cb7bb6f38c6afe8246e27b48ae17f673866ba1545041647c786d1183e6a2807d6642cba77ff069ccad5f66514cd170c2e013c8020866d6004b8826dfc14c92557030ccaad2fe7588a8d55cae9cc09bb05b90a1fc09928cda40cbbce9cf75b367d52baa457696ceb41b8ca2f04b5e71148656a7e3a865b9125c8b84d338ef013a6362e14dbde0d4a3d64377538
#
# (C) Tenable Network Security, Inc.
#

include("compat.inc");

if (description)
{
  script_id(87820);
  script_version("1.8");
  script_set_attribute(attribute:"plugin_modification_date", value:"2018/08/09");

  script_cve_id("CVE-2015-6429");
  script_bugtraq_id(79745);
  script_xref(name:"CISCO-BUG-ID", value:"CSCuw08236");
  script_xref(name:"CISCO-SA", value:"cisco-sa-20151218-ios");

  script_name(english:"Cisco IOS Software IKEv1 State Machine DoS (CSCuw08236)");
  script_summary(english:"Checks the IOS version.");

  script_set_attribute(attribute:"synopsis", value:
"The remote device is missing a vendor-supplied security patch.");
  script_set_attribute(attribute:"description", value:
"According to its self-reported version, the Cisco IOS software running
on the remote device is affected by a denial of service vulnerability
in the Internet Key Exchange version 1 (IKEv1) subsystem due to
insufficient condition checks in the IKEv1 state machine. An
unauthenticated, remote attacker can exploit this vulnerability, by
sending a spoofed, specific IKEv1 packet to an endpoint of an IPsec
tunnel, to tear down IPsec tunnels that terminate on the endpoint,
resulting in a partial denial of service condition.");
  # https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20151218-ios
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?1b10e25c");
  script_set_attribute(attribute:"see_also", value:"https://bst.cloudapps.cisco.com/bugsearch/bug/CSCuw08236");
  script_set_attribute(attribute:"solution", value:
"Apply the relevant patch referenced in Cisco security advisory
cisco-sa-20151218-ios.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:N/I:N/A:P");
  script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L");

  script_set_attribute(attribute:"vuln_publication_date", value:"2015/12/18");
  script_set_attribute(attribute:"patch_publication_date", value:"2015/12/18");
  script_set_attribute(attribute:"plugin_publication_date", value:"2016/01/08");

  script_set_attribute(attribute:"plugin_type", value:"local");
  script_set_attribute(attribute:"cpe", value:"cpe:/o:cisco:ios");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_family(english:"CISCO");

  script_copyright(english:"This script is Copyright (C) 2016-2018 Tenable Network Security, Inc.");

  script_dependencies("cisco_ios_version.nasl");
  script_require_keys("Host/Cisco/IOS/Version");

  exit(0);
}

include("audit.inc");
include("cisco_func.inc");
include("cisco_kb_cmd_func.inc");

flag = 0;
override = 0;

ver = get_kb_item_or_exit("Host/Cisco/IOS/Version");

# Check for vuln versions
if (
  ver == '15.4(3)S' ||
  ver == '15.5(3)M' ||
  ver == '15.5(3)M1' ||
  ver == '15.5(1)S' ||
  ver == '15.5(2)S' ||  # Maps to IOS XE 3.15.0S
  ver == '15.5(2)S1' || # Maps to IOS XE 3.15.1S
  ver == '15.5(2)S2' || # Maps to IOS XE 3.15.2S
  ver == '15.5(3)S' ||  # Maps to IOS XE 3.16.0S
  ver == '15.5(3)S1' || # Maps to IOS XE 3.16.1S
  ver == '15.5(1)T' ||
  ver == '15.5(2)T' ||
  ver == '15.6(1)S' ||  # Maps to IOS XE 3.17.0S
  ver == '15.6(1)S1' || # Maps to IOS XE 3.17.1S
  ver == '15.6(1)T0a'
) flag++;

cmds = make_list();
# Check that IKEv1 or ISAKMP is running
if (flag && get_kb_item("Host/local_checks_enabled"))
{
  pat = "(\d+.\d+.\d+.\d+|.*:.*|UNKNOWN|--any--)\s+(500|848|4500)\s";

  flag = 0;
  buf = cisco_command_kb_item("Host/Cisco/Config/show_ip_sockets","show ip sockets");
  if (check_cisco_result(buf))
  {
    if (
      preg(multiline:TRUE, pattern:pat, string:buf)
    )
    {
      flag = 1;
      cmds = make_list(cmds, "show ip sockets");
    }
  }
  else if (cisco_needs_enable(buf))
  {
    flag = 1;
    override = 1;
  }

  if (!flag)
  {
    buf = cisco_command_kb_item("Host/Cisco/Config/show_udp","show udp");
    if (check_cisco_result(buf))
    {
      if (
        preg(multiline:TRUE, pattern:pat, string:buf)
      )
      {
        flag = 1;
        cmds = make_list(cmds, "show udp");
      }
    }
    else if (cisco_needs_enable(buf))
    {
      flag = 1;
      override = 1;
    }
  }
}

if (flag)
{
  security_report_cisco(
    port     : 0,
    severity : SECURITY_WARNING,
    override : override,
    version  : ver,
    bug_id   : "CSCuw08236",
    cmds     : cmds
  );
  exit(0);
}
else audit(AUDIT_HOST_NOT, "affected");