Vulnerabilities > CVE-2016-1287 - Improper Restriction of Operations within the Bounds of a Memory Buffer vulnerability in Cisco Adaptive Security Appliance Software
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
Common Weakness Enumeration (CWE)
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
description | Cisco ASA Software IKEv1 and IKEv2 Buffer Overflow. CVE-2016-1287. Remote exploit for hardware platform |
file | exploits/hardware/remote/39823.py |
id | EDB-ID:39823 |
last seen | 2016-05-17 |
modified | 2016-05-17 |
platform | hardware |
port | |
published | 2016-05-17 |
reporter | Exodus Intelligence |
source | https://www.exploit-db.com/download/39823/ |
title | Cisco ASA Software 8.x / 9.x - IKEv1 and IKEv2 Buffer Overflow |
type | remote |
Nessus
NASL family CISCO NASL id CISCO_IKE_FRAGMENTATION_RCE.NASL description The 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 seen 2020-06-01 modified 2020-06-02 plugin id 89033 published 2016-02-29 reporter This script is Copyright (C) 2016-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/89033 title Cisco ASA / IOS IKE Fragmentation Vulnerability NASL family CISCO NASL id CISCO-SA-20160210-ASA-IKE.NASL description The 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 seen 2020-03-17 modified 2016-02-12 plugin id 88713 published 2016-02-12 reporter This script is Copyright (C) 2016-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/88713 title Cisco ASA Software IKEv1 and IKEv2 UDP Packet Handling RCE (cisco-sa-20160210-asa-ike)
Packetstorm
data source | https://packetstormsecurity.com/files/download/137100/ciscoasa-overflow.txt |
id | PACKETSTORM:137100 |
last seen | 2016-12-05 |
published | 2016-05-17 |
reporter | Exodus Intelligence |
source | https://packetstormsecurity.com/files/137100/Cisco-ASA-Software-IKEv1-IKEv2-Buffer-Overflow.html |
title | Cisco ASA Software IKEv1 / IKEv2 Buffer Overflow |
Seebug
bulletinFamily | exploit |
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. ``` |
id | SSV:92726 |
last seen | 2017-11-19 |
modified | 2017-03-01 |
published | 2017-03-01 |
reporter | 名匿 |
source | https://www.seebug.org/vuldb/ssvid-92726 |
title | Cisco ASA Remote Code Execution (CVE-2016-1287) |
Related news
References
- http://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20160210-asa-ike
- http://packetstormsecurity.com/files/137100/Cisco-ASA-Software-IKEv1-IKEv2-Buffer-Overflow.html
- https://www.exploit-db.com/exploits/39823/
- https://www.kb.cert.org/vuls/id/327976
- http://www.securitytracker.com/id/1034997
- https://blog.exodusintel.com/2016/02/10/firewall-hacking/