Vulnerabilities > CVE-2016-6366 - Improper Restriction of Operations within the Bounds of a Memory Buffer vulnerability in Cisco products

047910
CVSS 8.8 - HIGH
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
LOW
Confidentiality impact
HIGH
Integrity impact
HIGH
Availability impact
HIGH
network
low complexity
cisco
CWE-119
nessus
exploit available
metasploit

Summary

Buffer overflow in Cisco Adaptive Security Appliance (ASA) Software through 9.4.2.3 on ASA 5500, ASA 5500-X, ASA Services Module, ASA 1000V, ASAv, Firepower 9300 ASA Security Module, PIX, and FWSM devices allows remote authenticated users to execute arbitrary code via crafted IPv4 SNMP packets, aka Bug ID CSCva92151 or EXTRABACON.

Vulnerable Configurations

Part Description Count
Application
Cisco
11
OS
Cisco
294

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.

Exploit-Db

idEDB-ID:40258

Metasploit

descriptionThis module patches the authentication functions of a Cisco ASA to allow uncredentialed logins. Uses improved shellcode for payload.
idMSF:AUXILIARY/ADMIN/CISCO/CISCO_ASA_EXTRABACON
last seen2020-05-23
modified2020-05-12
published2016-09-22
references
reporterRapid7
sourcehttps://github.com/rapid7/metasploit-framework/blob/master//modules/auxiliary/admin/cisco/cisco_asa_extrabacon.rb
titleCisco ASA Authentication Bypass (EXTRABACON)

Nessus

NASL familyCISCO
NASL idCISCO-SN-CSCVA92151-ASA.NASL
descriptionAccording to its banner and configuration, the version of the remote Cisco Adaptive Security Appliance (ASA) device is affected by a remote code execution vulnerability, known as EXTRABACON, in the Simple Network Management Protocol (SNMP) code due to a buffer overflow condition. An authenticated, remote attacker can exploit this, via specially crafted IPv4 SNMP packets, to cause a denial of service condition or the execution of arbitrary code. Note that an attacker must know the SNMP community string in order to exploit the vulnerability. EXTRABACON is one of multiple Equation Group vulnerabilities and exploits disclosed on 2016/08/14 by a group known as the Shadow Brokers.
last seen2020-06-01
modified2020-06-02
plugin id93113
published2016-08-25
reporterThis script is Copyright (C) 2016-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
sourcehttps://www.tenable.com/plugins/nessus/93113
titleCisco ASA SNMP Packet Handling RCE (CSCva92151) (EXTRABACON)
code
#TRUSTED 4c1f563e82744185308df81445399742c7e383bd2695b8f26d5fb41f05da8b5315567f4bb4740d9c2291a9720e3d5dd11840996b3fad09932ecdd12d4ccd8fc1d594f779e3c66c3975a97f9e6550a55bac694640fb337434b4cd425697c858414b292cd1d563e1e78fe5f9d2054e8e20d3c74a362388276fd4395c5ac4c71b2f03eea6b419026196ea7b2e9f4b49716b77451e4f65566a59767ffeea1e4f8339d37af5c695e592b2676526716d3821c9968717d2421a9995d1e03b6b4e4c24b445078109656b1918173431ea50899423d0779fe516e32a08bb7343d406deb6cef60e09fb9a310029fbb157fb851b0565e0151814bd52140abf7721258a3c8629d21e74ac570393eae9ec676a2141ac79cd7eff6257a69a51c2f455fa48c0b232f04277712323fe0137a892f7520dab13466d5669347dc2eae60c229d302554c2ec6bf08f1804352bab37db48e4012cd59e180e7fc1e896c6c9f0d025886c1f8aeb4a23b82039569467d830bafcbc898d99f9a07ca12314fc8eed86160d9711531354671d103b14b83304d50e6f1415359d2a549e91c3850e228cb3eb4f609dd384f604e96c2e389f594d62926d7e3a8804d2700c6bd0c9572571664e14327ed6e977768c9a7fbb0519129ef9cff200cabafe6b5657f1c97b6f73130172cdb5a628daef8660312957991a198c6a96701bcf898a134a8ae2f7f49b695c6142b97d
#
# (C) Tenable Network Security, Inc.
#

include("compat.inc");

if (description)
{
  script_id(93113);
  script_version("1.14");
  script_cvs_date("Date: 2019/11/14");

  script_cve_id("CVE-2016-6366");
  script_bugtraq_id(92521);
  script_xref(name:"CISCO-BUG-ID", value:"CSCva92151");
  script_xref(name:"CISCO-SA", value:"cisco-sa-20160817-asa-snmp");
  script_xref(name:"EDB-ID", value:"40258");

  script_name(english:"Cisco ASA SNMP Packet Handling RCE (CSCva92151) (EXTRABACON)");
  script_summary(english:"Checks the ASA 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 banner and configuration, the version of the remote
Cisco Adaptive Security Appliance (ASA) device is affected by a remote
code execution vulnerability, known as EXTRABACON, in the Simple
Network Management Protocol (SNMP) code due to a buffer overflow
condition. An authenticated, remote attacker can exploit this, via
specially crafted IPv4 SNMP packets, to cause a denial of service
condition or the execution of arbitrary code. Note that an attacker
must know the SNMP community string in order to exploit the
vulnerability.

EXTRABACON is one of multiple Equation Group vulnerabilities and
exploits disclosed on 2016/08/14 by a group known as the Shadow
Brokers.");
  # https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20160817-asa-snmp
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?158a2c56");
  script_set_attribute(attribute:"see_also", value:"https://bst.cloudapps.cisco.com/bugsearch/bug/CSCva92151");
  script_set_attribute(attribute:"see_also", value:"https://blogs.cisco.com/security/shadow-brokers");
  # https://www.riskbasedsecurity.com/2016/08/the-shadow-brokers-lifting-the-shadows-of-the-nsas-equation-group/
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?4c7e0cf3");
  script_set_attribute(attribute:"solution", value:
"Upgrade to the relevant fixed version referenced in Cisco bug ID
CSCva92151. Alternatively, as a workaround, change the SNMP community
string, and only allow trusted users to have SNMP access.

Additionally, administrators can monitor affected systems using the
'snmp-server' host command.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:S/C:C/I:C/A:C");
  script_set_cvss_temporal_vector("CVSS2#E:F/RL:OF/RC:C");
  script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H");
  script_set_cvss3_temporal_vector("CVSS:3.0/E:F/RL:O/RC:C");
  script_set_attribute(attribute:"cvss_score_source", value:"CVE-2016-6366");

  script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"true");
  script_set_attribute(attribute:"exploit_framework_core", value:"true");
  script_set_attribute(attribute:"exploit_framework_canvas", value:"true");
  script_set_attribute(attribute:"canvas_package", value:'CANVAS');
  script_set_attribute(attribute:"in_the_news", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2016/08/14");
  script_set_attribute(attribute:"patch_publication_date", value:"2016/08/17");
  script_set_attribute(attribute:"plugin_publication_date", value:"2016/08/25");

  script_set_attribute(attribute:"plugin_type", value:"local");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:cisco:adaptive_security_appliance_software");
  script_end_attributes();

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

  script_copyright(english:"This script is Copyright (C) 2016-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");

  script_dependencies("ssh_get_info.nasl");
  script_require_keys("Host/Cisco/ASA");

  exit(0);
}

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

# Convert 'Cisco versions' to dot notation
# a.b(c.d) to a.b.c.d
# a.b(c)d  to a.b.c.d
function toVerDot(ver)
{
  local_var ver_dot = str_replace(string:ver, find:'(', replace:'.');
  local_var matches = pregmatch(string:ver_dot, pattern:"^(.*)\)$");

  if (matches) ver_dot = matches[1];
  else ver_dot = str_replace(string:ver_dot, find:')', replace:'.');

  return ver_dot;
}

asa   = get_kb_item_or_exit('Host/Cisco/ASA');

app = "Cisco ASA";

ver = extract_asa_version(asa);
if (isnull(ver)) audit(AUDIT_FN_FAIL, 'extract_asa_version');

ver_dot = toVerDot(ver:ver);

fix = FALSE;

# versions 7.2, 8.0-8.7
if (ver =~ "^[78]\.[0-7]")
{
  # won't check granularity for this
  # affected; migrate to 9.1.7(9) or later
  fix = "9.1.7(9)";
}
# versions 9.0-9.6
else if (ver =~ "^9\.[0-6]")
{
  match = pregmatch(string:ver, pattern:"^9\.([0-9])");
  if (!isnull(match))
  {
    if (match[1] == "0")      fix = "9.0.4(40)";
    else if (match[1] == "1") fix = "9.1.7(9)";
    else if (match[1] == "2") fix = "9.2.4(14)";
    else if (match[1] == "3") fix = "9.3.3(10)";
    else if (match[1] == "4") fix = "9.4.3(8)";
    else if (match[1] == "5") fix = "9.5(3)";
    else if (match[1] == "6") fix = "9.6.1(11)";
  }
}

fix_dot = FALSE;
if (fix) fix_dot = toVerDot(ver:fix);

if ((!fix_dot) || ver_compare(ver:ver_dot, fix:fix_dot, strict:FALSE) >= 0)
  audit(AUDIT_INST_VER_NOT_VULN, app, ver);

override = FALSE;
snmp_disabled = FALSE;
if (get_kb_item("Host/local_checks_enabled"))
{
  # Check if SNMP is enabled
  buf = cisco_command_kb_item(
    "Host/Cisco/Config/show_running-config",
    "show running-config"
  );
  if (check_cisco_result(buf))
  {
    if (preg(multiline:TRUE, pattern:"no snmp-server enable", string:buf))
      snmp_disabled = TRUE;
  }
  else if (cisco_needs_enable(buf)) override = TRUE;
}

if (snmp_disabled)
  audit(AUDIT_HOST_NOT, "affected because the SNMP server is not enabled");

if (report_verbosity > 0)
{
  report =
    '\n  Installed version : ' + ver +
    '\n  Fixed version     : ' + fix +
    '\n';
  security_hole(port:0, extra:report + cisco_caveat(override));
}
else security_hole(port:0, extra:cisco_caveat(override));

The Hacker News