Vulnerabilities > CVE-2016-1287 - Improper Restriction of Operations within the Bounds of a Memory Buffer vulnerability in Cisco Adaptive Security Appliance Software

047910
CVSS 9.8 - CRITICAL
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
NONE
Confidentiality impact
HIGH
Integrity impact
HIGH
Availability impact
HIGH
network
low complexity
cisco
CWE-119
critical
nessus
exploit available

Summary

Buffer overflow in the IKEv1 and IKEv2 implementations in Cisco ASA Software before 8.4(7.30), 8.7 before 8.7(1.18), 9.0 before 9.0(4.38), 9.1 before 9.1(7), 9.2 before 9.2(4.5), 9.3 before 9.3(3.7), 9.4 before 9.4(2.4), and 9.5 before 9.5(2.2) on ASA 5500 devices, ASA 5500-X devices, ASA Services Module for Cisco Catalyst 6500 and Cisco 7600 devices, ASA 1000V devices, Adaptive Security Virtual Appliance (aka ASAv), Firepower 9300 ASA Security Module, and ISA 3000 devices allows remote attackers to execute arbitrary code or cause a denial of service (device reload) via crafted UDP packets, aka Bug IDs CSCux29978 and CSCux42019.

Vulnerable Configurations

Part Description Count
OS
Cisco
199

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

descriptionCisco ASA Software IKEv1 and IKEv2 Buffer Overflow. CVE-2016-1287. Remote exploit for hardware platform
fileexploits/hardware/remote/39823.py
idEDB-ID:39823
last seen2016-05-17
modified2016-05-17
platformhardware
port
published2016-05-17
reporterExodus Intelligence
sourcehttps://www.exploit-db.com/download/39823/
titleCisco ASA Software 8.x / 9.x - IKEv1 and IKEv2 Buffer Overflow
typeremote

Nessus

  • NASL familyCISCO
    NASL idCISCO_IKE_FRAGMENTATION_RCE.NASL
    descriptionThe remote Cisco Adaptive Security Appliance (ASA) or device running IOS / IOS XE is affected by one of the following vulnerabilities in the Internet Key Exchange (IKE) implementation : - An overflow condition exists in both the IKE and IKEv2 implementations due to improper validation of user-supplied input when handling UDP packets. An unauthenticated, remote attacker can exploit this issue, via specially crafted UDP packets, to cause a buffer overflow condition, resulting in a denial of service or the execution of arbitrary code. (CVE-2016-1287) - A denial of service vulnerability exists in the IKEv2 implementation due to improper handling of fragmented IKEv2 packets. An unauthenticated, remote attacker can exploit this issue, via specially crafted UDP packets, to cause the device to reload. (CVE-2016-1344)
    last seen2020-06-01
    modified2020-06-02
    plugin id89033
    published2016-02-29
    reporterThis script is Copyright (C) 2016-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/89033
    titleCisco ASA / IOS IKE Fragmentation Vulnerability
  • NASL familyCISCO
    NASL idCISCO-SA-20160210-ASA-IKE.NASL
    descriptionThe remote Cisco Adaptive Security Appliance (ASA) is missing a vendor-supplied security patch. It is, therefore, affected by a remote code execution vulnerability due to an overflow condition in the Internet Key Exchange (IKE) implementation. An unauthenticated, remote attacker can exploit this, via specially crafted UDP packets, to cause a denial of service or the execution of arbitrary code. Note that only systems configured in routed firewall mode and single / multiple context mode are affected.
    last seen2020-03-17
    modified2016-02-12
    plugin id88713
    published2016-02-12
    reporterThis script is Copyright (C) 2016-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/88713
    titleCisco ASA Software IKEv1 and IKEv2 UDP Packet Handling RCE (cisco-sa-20160210-asa-ike)

Packetstorm

data sourcehttps://packetstormsecurity.com/files/download/137100/ciscoasa-overflow.txt
idPACKETSTORM:137100
last seen2016-12-05
published2016-05-17
reporterExodus Intelligence
sourcehttps://packetstormsecurity.com/files/137100/Cisco-ASA-Software-IKEv1-IKEv2-Buffer-Overflow.html
titleCisco ASA Software IKEv1 / IKEv2 Buffer Overflow

Seebug

bulletinFamilyexploit
description#### Remote Code Execution on Cisco ASA A year ago ExodusIntel disclosed a vulnerability affecting the IKE implementation in Cisco’s ASA products. The error is due to an overflow in the checking of reassembled IKE fragments, and allows remote code execution from an unauthenticated attacker. More information on the technical aspects of this can be found at ExodusIntel’s blog here. As Cisco ASAs are widely used in the industry, we started to see this vulnerability come up in many penetration tests, but it was hard to verify beyond the fact that a scanner found this issue. The consulting team here at NetSPI, as well as our clients, wanted a more verbose verification that this vulnerability was present. #### Creating the Verification Tool In order to get a concrete verification for this, I first read through all the write-ups on the vulnerability. After I had a solid foundation of the flaw itself, I used vulnerability scanners to test a vulnerable ASA in our lab environment and did a packet capture. With this packet capture, and the scanner plugins I was able to figure out a good way to verify the presence of the vulnerability. I implemented a similar verification in Python which included output showing where the fragmentation reassembly fails. The ASA will either respond with an incomplete IKE notify packet, indicating the ASA is vulnerable, or it will drop the invalid fragments and it will not respond, demonstrating that the patch has been applied. Examples of both of these scenarios can be seen below, note that these would typically be externally facing IP addresses, but as they were in a testing lab the WAN interface was on an internal network. ####Vulnerable ASA ``` pentest ~ $ python3 cisco_asa.py 10.10.1.100:500 This tool is used to verify the presence of CVE-2016-1287, an unauthenticated remote code execution vulnerability affecting Cisco's ASA products. No attempt will be made to execute code, this simply observes behavior of affected versions when malformed fragments are sent to the ASA. Continue? [y/N] y [*] Sending Initiator Request [*] Received Response [+] Valid SA found. Moving on [*] Sending first fragment [*] Sending second fragment [*] Notify Payload found. Printing Notify payload data. Next payload: NONE Critical bit Not Critical Payload length: 8 Protocol ID: IKE SPI Size: 0 Notify Message Type: Invalid Syntax Notification DATA: missing [+] Notification data is missing. ASA is vulnerable. 00000000: 66 53 54 71 45 49 58 64 75 6A FD C0 52 32 52 96 fSTqEIXduj..R2R. 00000010: 29 20 22 20 00 00 00 00 00 00 00 24 00 00 00 08 ) " .......$.... 00000020: 01 00 00 07 .... ``` #### Patched ASA ``` pentest ~ $ python3 cisco_asa.py 10.10.1.100:500 This tool is used to verify the presence of CVE-2016-1287, an unauthenticated remote code execution vulnerability affecting Cisco's ASA products. No attempt will be made to execute code, this simply observes behavior of affected versions when malformed fragments are sent to the ASA. Continue? [y/N] y [*] Sending Initiator Request [*] Received Response [+] Valid SA found. Moving on [*] Sending first fragment [*] Sending second fragment [*] IKE Fragment was dropped indicating the ASA is not vulnerable. ```
idSSV:92726
last seen2017-11-19
modified2017-03-01
published2017-03-01
reporter名匿
sourcehttps://www.seebug.org/vuldb/ssvid-92726
titleCisco ASA Remote Code Execution (CVE-2016-1287)