CVE-2020-3982 - Out-of-bounds Write

Severity

77%

Complexity

13%

Confidentiality

96%

VMware ESXi (7.0 before ESXi_7.0.1-0.0.16850804, 6.7 before ESXi670-202008101-SG, 6.5 before ESXi650-202007101-SG), Workstation (15.x), Fusion (11.x before 11.5.6) contain an out-of-bounds write vulnerability due to a time-of-check time-of-use issue in ACPI device. A malicious actor with administrative access to a virtual machine may be able to exploit this vulnerability to crash the virtual machine's vmx process or corrupt hypervisor's memory heap.

CVSS 3.1 Base Score 7.7. CVSS Attack Vector: network. CVSS Attack Complexity: high. CVSS Vector: (CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:N/I:H/A:H).

CVSS 2.0 Base Score 4.9. CVSS Attack Vector: network. CVSS Attack Complexity: medium. CVSS Vector: (AV:N/AC:M/Au:S/C:N/I:P/A:P).

Demo Examples

Out-of-bounds Write

CWE-787

The following code attempts to save four different identification numbers into an array.


               
id_sequence[3] = 456;

Out-of-bounds Write

CWE-787

In the following example, it is possible to request that memcpy move a much larger segment of memory than assumed:


               
}
.../* if chunk info is valid, return the size of usable memory,* else, return -1 to indicate an error*/
...

If returnChunkSize() happens to encounter an error it will return -1. Notice that the return value is not checked before the memcpy operation (CWE-252), so -1 can be passed as the size argument to memcpy() (CWE-805). Because memcpy() assumes that the value is unsigned, it will be interpreted as MAXINT-1 (CWE-195), and therefore will copy far more memory than is likely available to the destination buffer (CWE-787, CWE-788).

Out-of-bounds Write

CWE-787

This example takes an IP address from a user, verifies that it is well formed and then looks up the hostname and copies it into a buffer.


               
}
strcpy(hostname, hp->h_name);/*routine that ensures user_supplied_addr is in the right format for conversion */

This function allocates a buffer of 64 bytes to store the hostname, however there is no guarantee that the hostname will not be larger than 64 bytes. If an attacker specifies an address which resolves to a very large hostname, then we may overwrite sensitive data or even relinquish control flow to the attacker.

Note that this example also contains an unchecked return value (CWE-252) that can lead to a NULL pointer dereference (CWE-476).

Out-of-bounds Write

CWE-787

This example applies an encoding procedure to an input string and stores it into a buffer.


               
}
return dst_buf;
die("user string too long, die evil hacker!");
else dst_buf[dst_index++] = user_supplied_string[i];
dst_buf[dst_index++] = ';';
/* encode to < */

The programmer attempts to encode the ampersand character in the user-controlled string, however the length of the string is validated before the encoding procedure is applied. Furthermore, the programmer assumes encoding expansion will only expand a given character by a factor of 4, while the encoding of the ampersand expands by 5. As a result, when the encoding procedure expands the string it is possible to overflow the destination buffer if the attacker provides a string of many ampersands.

Out-of-bounds Write

CWE-787

In the following C/C++ example, a utility function is used to trim trailing whitespace from a character string. The function copies the input string to a local character string and uses a while statement to remove the trailing whitespace by moving backward through the string and overwriting whitespace with a NUL character.


               
}
return retMessage;// copy input string to a temporary string
message[index] = strMessage[index];
// trim trailing whitespace
len--;
// return string without trailing whitespace

However, this function can cause a buffer underwrite if the input character string contains all whitespace. On some systems the while statement will move backwards past the beginning of a character string and will call the isspace() function on an address outside of the bounds of the local buffer.

Out-of-bounds Write

CWE-787

The following is an example of code that may result in a buffer underwrite, if find() returns a negative value to indicate that ch is not found in srcBuf:


               
}
...

If the index to srcBuf is somehow under user control, this is an arbitrary write-what-where condition.

Demo Examples

Time-of-check Time-of-use (TOCTOU) Race Condition

CWE-367

The following code checks a file, then updates its contents.


               
}
updateThings();

Potentially the file could have been updated between the time of the check and the lstat, especially since the printf has latency.

Time-of-check Time-of-use (TOCTOU) Race Condition

CWE-367

The following code is from a program installed setuid root. The program performs certain file operations on behalf of non-privileged users, and uses access checks to ensure that it does not use its root privileges to perform operations that should otherwise be unavailable the current user. The program uses the access() system call to check if the person running the program has permission to access the specified file before it opens the file and performs the necessary operations.


               
}
...
fprintf(stderr,"Unable to open file %s.\n",file);

The call to access() behaves as expected, and returns 0 if the user running the program has the necessary permissions to write to the file, and -1 otherwise. However, because both access() and fopen() operate on filenames rather than on file handles, there is no guarantee that the file variable still refers to the same file on disk when it is passed to fopen() that it did when it was passed to access(). If an attacker replaces file after the call to access() with a symbolic link to a different file, the program will use its root privileges to operate on the file even if it is a file that the attacker would otherwise be unable to modify. By tricking the program into performing an operation that would otherwise be impermissible, the attacker has gained elevated privileges. This type of vulnerability is not limited to programs with root privileges. If the application is capable of performing any operation that the attacker would not otherwise be allowed perform, then it is a possible target.

Time-of-check Time-of-use (TOCTOU) Race Condition

CWE-367

This code prints the contents of a file if a user has permission.


               
}
}//resolve file if its a symbolic link
$filename = readlink($filename);
return;
return false;

This code attempts to resolve symbolic links before checking the file and printing its contents. However, an attacker may be able to change the file from a real file to a symbolic link between the calls to is_link() and file_get_contents(), allowing the reading of arbitrary files. Note that this code fails to log the attempted access (CWE-778).

Overview

First reported 4 years ago

2020-10-20 17:15:00

Last updated 4 years ago

2020-10-30 16:53:00

Affected Software

VMware Esxi 6.7

6.7

VMware ESXi 6.7 670-201806001

6.7

VMware ESXi 6.7 670-201807001

6.7

VMware ESXi 6.7 670-201808001

6.7

VMware ESXi 6.7 670-201810001

6.7

VMware ESXi 6.7 670-201810101

6.7

VMware ESXi 6.7 670-201810102

6.7

VMware ESXi 6.7 670-201810103

6.7

VMware ESXi 6.7 670-201810201

6.7

VMware ESXi 6.7 670-201810202

6.7

VMware ESXi 6.7 670-201810203

6.7

VMware ESXi 6.7 670-201810204

6.7

VMware ESXi 6.7 670-201810205

6.7

VMware ESXi 6.7 670-201810206

6.7

VMware ESXi 6.7 670-201810207

6.7

VMware ESXi 6.7 670-201810208

6.7

VMware ESXi 6.7 670-201810209

6.7

VMware ESXi 6.7 670-201810210

6.7

VMware ESXi 6.7 670-201810211

6.7

VMware ESXi 6.7 670-201810212

6.7

VMware ESXi 6.7 670-201810213

6.7

VMware ESXi 6.7 670-201810214

6.7

VMware ESXi 6.7 670-201810215

6.7

VMware ESXi 6.7 670-201810216

6.7

VMware ESXi 6.7 670-201810217

6.7

VMware ESXi 6.7 670-201810218

6.7

VMware ESXi 6.7 670-201810219

6.7

VMware ESXi 6.7 670-201810220

6.7

VMware ESXi 6.7 670-201810221

6.7

VMware ESXi 6.7 670-201810222

6.7

VMware ESXi 6.7 670-201810223

6.7

VMware ESXi 6.7 670-201810224

6.7

VMware ESXi 6.7 670-201810225

6.7

VMware ESXi 6.7 670-201810226

6.7

VMware ESXi 6.7 670-201810227

6.7

VMware ESXi 6.7 670-201810228

6.7

VMware ESXi 6.7 670-201810229

6.7

VMware ESXi 6.7 670-201810230

6.7

VMware ESXi 6.7 670-201810231

6.7

VMware ESXi 6.7 670-201810232

6.7

VMware ESXi 6.7 670-201810233

6.7

VMware ESXi 6.7 670-201810234

6.7

VMware ESXi 6.7 670-201811001

6.7

VMware ESXi 6.7 670-201901001

6.7

VMware ESXi 6.7 670-201901401

6.7

VMware ESXi 6.7 670-201901402

6.7

VMware ESXi 6.7 670-201901403

6.7

VMware Esxi 6.7 670-201903001

6.7

VMware Esxi 6.7 670-201904001

6.7

VMware ESXi 6.7 670-201904201

6.7

VMware ESXi 6.7 670-201904201-UG

6.7

VMware ESXi 6.7 670-201904202

6.7

VMware ESXi 6.7 670-201904202-UG

6.7

VMware ESXi 6.7 670-201904203

6.7

VMware ESXi 6.7 670-201904203-UG

6.7

VMware ESXi 6.7 670-201904204

6.7

VMware ESXi 6.7 670-201904204-UG

6.7

VMware ESXi 6.7 670-201904205

6.7

VMware ESXi 6.7 670-201904205-UG

6.7

VMware ESXi 6.7 670-201904206

6.7

VMware ESXi 6.7 670-201904206-UG

6.7

VMware ESXi 6.7 670-201904207

6.7

VMware ESXi 6.7 670-201904207-UG

6.7

VMware ESXi 6.7 670-201904208

6.7

VMware ESXi 6.7 670-201904208-UG

6.7

VMware ESXi 6.7 670-201904209

6.7

VMware ESXi 6.7 670-201904209-UG

6.7

VMware ESXi 6.7 670-201904210

6.7

VMware ESXi 6.7 670-201904210-UG

6.7

VMware ESXi 6.7 670-201904211

6.7

VMware ESXi 6.7 670-201904211-UG

6.7

VMware ESXi 6.7 670-201904212

6.7

VMware ESXi 6.7 670-201904212-UG

6.7

VMware ESXi 6.7 670-201904213

6.7

VMware ESXi 6.7 670-201904213-UG

6.7

VMware ESXi 6.7 670-201904214

6.7

VMware ESXi 6.7 670-201904214-UG

6.7

VMware ESXi 6.7 670-201904215

6.7

VMware ESXi 6.7 670-201904215-UG

6.7

VMware ESXi 6.7 670-201904216

6.7

VMware ESXi 6.7 670-201904216-UG

6.7

VMware ESXi 6.7 670-201904217

6.7

VMware ESXi 6.7 670-201904217-UG

6.7

VMware ESXi 6.7 670-201904218

6.7

VMware ESXi 6.7 670-201904218-UG

6.7

VMware ESXi 6.7 670-201904219

6.7

VMware ESXi 6.7 670-201904219-UG

6.7

VMware ESXi 6.7 670-201904220

6.7

VMware ESXi 6.7 670-201904220-UG

6.7

VMware ESXi 6.7 670-201904221

6.7

VMware ESXi 6.7 670-201904221-UG

6.7

VMware ESXi 6.7 670-201904222

6.7

VMware ESXi 6.7 670-201904222-UG

6.7

VMware ESXi 6.7 670-201904223

6.7

VMware ESXi 6.7 670-201904223-UG

6.7

VMware ESXi 6.7 670-201904224

6.7

VMware ESXi 6.7 670-201904224-UG

6.7

VMware ESXi 6.7 670-201904225

6.7

VMware ESXi 6.7 670-201904225-UG

6.7

VMware ESXi 6.7 670-201904226

6.7

VMware ESXi 6.7 670-201904226-UG

6.7

VMware ESXi 6.7 670-201904227

6.7

VMware ESXi 6.7 670-201904227-UG

6.7

VMware ESXi 6.7 670-201904228

6.7

VMware ESXi 6.7 670-201904228-UG

6.7

VMware ESXi 6.7 670-201904229

6.7

VMware ESXi 6.7 670-201904229-UG

6.7

VMware Esxi 6.7 670-201905001

6.7

VMware Esxi 6.7 670-201906002

6.7

VMware Esxi 6.7 670-201908101

6.7

VMware Esxi 6.7 670-201908102

6.7

VMware Esxi 6.7 670-201908103

6.7

VMware Esxi 6.7 670-201908104

6.7

VMware Esxi 6.7 670-201908201

6.7

VMware Esxi 6.7 670-201908202

6.7

VMware Esxi 6.7 670-201908203

6.7

VMware Esxi 6.7 670-201908204

6.7

VMware Esxi 6.7 670-201908205

6.7

VMware Esxi 6.7 670-201908206

6.7

VMware Esxi 6.7 670-201908207

6.7

VMware Esxi 6.7 670-201908208

6.7

VMware Esxi 6.7 670-201908209

6.7

VMware Esxi 6.7 670-201908210

6.7

VMware Esxi 6.7 670-201908211

6.7

VMware Esxi 6.7 670-201908212

6.7

VMware Esxi 6.7 670-201908213

6.7

VMware Esxi 6.7 670-201908214

6.7

VMware Esxi 6.7 670-201908215

6.7

VMware Esxi 6.7 670-201908216

6.7

VMware Esxi 6.7 670-201908217

6.7

VMware Esxi 6.7 670-201908218

6.7

VMware Esxi 6.7 670-201908219

6.7

VMware Esxi 6.7 670-201908220

6.7

VMware Esxi 6.7 670-201908221

6.7

VMware ESXi 6.7 670-201912001

6.7

VMware ESXi 6.7 670-201912101

6.7

VMware ESXi 6.7 670-201912102

6.7

VMware ESXi 6.7 670-201912401

6.7

VMware ESXi 6.7 670-201912402

6.7

VMware ESXi 6.7 670-201912403

6.7

VMware ESXi 6.7 670-201912404

6.7

VMware ESXi 6.7 670-201912405

6.7

VMware ESXi 6.7 670-202004001

6.7

VMware ESXi 6.7 670-202004002

6.7

VMware ESXi 6.7 670-202004301

6.7

VMware ESXi 6.7 670-202004401

6.7

VMware ESXi 6.7 670-202004402

6.7

VMware ESXi 6.7 670-202004403

6.7

VMware ESXi 6.7 670-202004404

6.7

VMware ESXi 6.7 670-202004405

6.7

VMware ESXi 6.7 670-202004406

6.7

VMware ESXi 6.7 670-202004407

6.7

VMware ESXi 6.7 670-202004408

6.7

VMware Esxi 6.5

6.5

Vmware ESXi 6.5 2

6.5

VMware ESXi 6.5 650-201701001

6.5

VMware ESXi 6.5 650-201703001

6.5

VMware ESXi 6.5 650-201703002

6.5

VMware ESXi 6.5 650-201704001

6.5

VMware ESXi 6.5 650-201707101

6.5

VMware ESXi 6.5 650-201707102

6.5

VMware ESXi 6.5 650-201707103

6.5

VMware ESXi 6.5 650-201707201

6.5

VMware ESXi 6.5 650-201707202

6.5

VMware ESXi 6.5 650-201707203

6.5

VMware ESXi 6.5 650-201707204

6.5

VMware ESXi 6.5 650-201707205

6.5

VMware ESXi 6.5 650-201707206

6.5

VMware ESXi 6.5 650-201707207

6.5

VMware ESXi 6.5 650-201707208

6.5

VMware ESXi 6.5 650-201707209

6.5

VMware ESXi 6.5 650-201707210

6.5

VMware ESXi 6.5 650-201707211

6.5

VMware ESXi 6.5 650-201707212

6.5

VMware ESXi 6.5 650-201707213

6.5

VMware ESXi 6.5 650-201707214

6.5

VMware ESXi 6.5 650-201707215

6.5

VMware ESXi 6.5 650-201707216

6.5

VMware ESXi 6.5 650-201707217

6.5

VMware ESXi 6.5 650-201707218

6.5

VMware ESXi 6.5 650-201707219

6.5

VMware ESXi 6.5 650-201707220

6.5

VMware ESXi 6.5 650-201707221

6.5

VMware ESXi 6.5 650-201710001

6.5

VMware ESXi 6.5 650-201712001

6.5

VMware ESXi 6.5 650-201803001

6.5

VMware ESXi 6.5 650-201806001

6.5

VMware ESXi 6.5 650-201808001

6.5

VMware ESXi 6.5 650-201810001

6.5

VMware ESXi 6.5 650-201810002

6.5

VMware ESXi 6.5 650-201811001

6.5

VMware ESXi 6.5 650-201811002

6.5

VMware ESXi 6.5 650-201811301

6.5

VMware ESXi 6.5 650-201901001

6.5

VMware ESXi 6.5 650-201903001

6.5

VMware ESXi 6.5 650-201905001

6.5

VMware Esxi 6.5 650-201908001

6.5

VMware Esxi 6.5 650-201910001

6.5

VMware Esxi 6.5 650-20191004001

6.5

VMware ESXi 6.5 650-201911001

6.5

VMware ESXi 6.5 650-201911401

6.5

VMware ESXi 6.5 650-201911402

6.5

VMware ESXi 6.5 650-201912001

6.5

VMware ESXi 6.5 650-201912002

6.5

VMware ESXi 6.5 650-201912101

6.5

VMware ESXi 6.5 650-201912102

6.5

VMware ESXi 6.5 650-201912103

6.5

VMware ESXi 6.5 650-201912104

6.5

VMware ESXi 6.5 650-201912301

6.5

VMware ESXi 6.5 650-201912401

6.5

VMware ESXi 6.5 650-201912402

6.5

VMware ESXi 6.5 650-201912403

6.5

VMware ESXi 6.5 650-201912404

6.5

VMware ESXi 6.5 650-202005001

6.5

VMware Cloud Foundation

Stay updated

ExploitPedia is constantly evolving. Sign up to receive a notification when we release additional functionality.

Get in touch

If you'd like to report a bug or have any suggestions for improvements then please do get in touch with us using this form. We will get back to you as soon as we can.