CVE-2020-15707 - Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')

Severity

64%

Complexity

5%

Confidentiality

98%

Integer overflows were discovered in the functions grub_cmd_initrd and grub_initrd_init in the efilinux component of GRUB2, as shipped in Debian, Red Hat, and Ubuntu (the functionality is not included in GRUB2 upstream), leading to a heap-based buffer overflow. These could be triggered by an extremely large number of arguments to the initrd command on 32-bit architectures, or a crafted filesystem with very large files on any architecture. An attacker could use this to execute arbitrary code and bypass UEFI Secure Boot restrictions. This issue affects GRUB2 version 2.04 and prior versions.

CVSS 3.1 Base Score 6.4. CVSS Attack Vector: local. CVSS Attack Complexity: high. CVSS Vector: (CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H).

CVSS 2.0 Base Score 4.4. CVSS Attack Vector: local. CVSS Attack Complexity: medium. CVSS Vector: (AV:L/AC:M/Au:N/C:P/I:P/A:P).

Demo Examples

Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')

CWE-362

This code could be used in an e-commerce application that supports transfers between accounts. It takes the total amount of the transfer, sends it to the new account, and deducts the amount from the original account.


               
NotifyUser("New balance: $newbalance");
FatalError("Bad Transfer Amount");
FatalError("Insufficient Funds");

A race condition could occur between the calls to GetBalanceFromDatabase() and SendNewBalanceToDatabase().

Suppose the balance is initially 100.00. An attack could be constructed as follows:


               
PROGRAM-2 sends a request to update the database, setting the balance to 99.00

At this stage, the attacker should have a balance of 19.00 (due to 81.00 worth of transfers), but the balance is 99.00, as recorded in the database.

To prevent this weakness, the programmer has several options, including using a lock to prevent multiple simultaneous requests to the web application, or using a synchronization mechanism that includes all the code between GetBalanceFromDatabase() and SendNewBalanceToDatabase().

Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')

CWE-362

The following function attempts to acquire a lock in order to perform operations on a shared resource.


               
}
pthread_mutex_unlock(mutex);/* access shared resource */

However, the code does not check the value returned by pthread_mutex_lock() for errors. If pthread_mutex_lock() cannot acquire the mutex for any reason, the function may introduce a race condition into the program and result in undefined behavior.

In order to avoid data races, correctly written programs must check the result of thread synchronization functions and appropriately handle all errors, either by attempting to recover from them or reporting it to higher levels.


               
}
return pthread_mutex_unlock(mutex);
return result;
/* access shared resource */

Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')

CWE-362

Suppose a processor's Memory Management Unit (MMU) has 5 other shadow MMUs to distribute its workload for its various cores. Each MMU has the start address and end address of "accessible" memory. Any time this accessible range changes (as per the processor's boot status), the main MMU sends an update message to all the shadow MMUs.

Suppose the interconnect fabric does not prioritize such "update" packets over other general traffic packets. This introduces a race condition. If an attacker can flood the target with enough messages so that some of those attack packets reach the target before the new access ranges gets updated, then the attacker can leverage this scenario.

Overview

First reported 4 years ago

2020-07-29 18:15:00

Last updated 4 years ago

2020-08-08 18:15:00

Affected Software

GNU GRUB2

Red Hat Enterprise Linux Atomic Host

Red Hat Openshift Container Platform 4.0

4.0

Canonical Ubuntu Linux 14.04 ESM Edition

14.04

Canonical Ubuntu Linux 16.04 LTS (Long-Term Support)

16.04

Canonical Ubuntu Linux 18.04 LTS Edition

18.04

Canonical Ubuntu Linux 20.04 LTS Edition

20.04

Debian Linux 10

10

Red Hat Enterprise Linux (RHEL) 7.0 (7)

7.0

Red Hat Enterprise Linux 8.0

8.0

SUSE Linux Enterprise Server (SLES) 11

11

SUSE Linux Enterprise Server (SLES) 12

12

SUSE Linux Enterprise Server (SLES) 15

15

Microsoft Windows 10 1709

1709

Microsoft Windows 10 1803

1803

Microsoft Windows 10 1809

1809

Microsoft Windows 10 1909

1909

Microsoft Windows RT 8.1

Microsoft Windows Server 2012

Microsoft Windows Server 2016

Microsoft Windows Server 2016 1909

1909

Microsoft Windows Server 2019

References

http://ubuntu.com/security/notices/USN-4432-1

[oss-security] 20200729 multiple secure boot grub2 and linux kernel vulnerabilities

https://access.redhat.com/security/vulnerabilities/grub2bootloader

https://lists.gnu.org/archive/html/grub-devel/2020-07/msg00034.html

https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/ADV200011

https://wiki.ubuntu.com/SecurityTeam/KnowledgeBase/GRUB2SecureBootBypass

DSA-4735

https://www.debian.org/security/2020-GRUB-UEFI-SecureBoot

https://www.eclypsium.com/2020/07/29/theres-a-hole-in-the-boot/

https://www.openwall.com/lists/oss-security/2020/07/29/3

https://www.suse.com/c/suse-addresses-grub2-secure-boot-issue/

https://www.suse.com/support/kb/doc/?id=000019673

https://security.netapp.com/advisory/ntap-20200731-0008/

http://ubuntu.com/security/notices/USN-4432-1

Third Party Advisory

[oss-security] 20200729 multiple secure boot grub2 and linux kernel vulnerabilities

Mailing List, Third Party Advisory

https://access.redhat.com/security/vulnerabilities/grub2bootloader

Third Party Advisory

https://lists.gnu.org/archive/html/grub-devel/2020-07/msg00034.html

Issue Tracking, Vendor Advisory

https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/ADV200011

Third Party Advisory

https://security.netapp.com/advisory/ntap-20200731-0008/

Third Party Advisory

https://wiki.ubuntu.com/SecurityTeam/KnowledgeBase/GRUB2SecureBootBypass

Third Party Advisory

DSA-4735

Third Party Advisory

https://www.debian.org/security/2020-GRUB-UEFI-SecureBoot

Third Party Advisory

https://www.eclypsium.com/2020/07/29/theres-a-hole-in-the-boot/

Exploit, Third Party Advisory

https://www.openwall.com/lists/oss-security/2020/07/29/3

Mailing List, Third Party Advisory

https://www.suse.com/c/suse-addresses-grub2-secure-boot-issue/

Third Party Advisory

https://www.suse.com/support/kb/doc/?id=000019673

Third Party Advisory

USN-4432-1

openSUSE-SU-2020:1168

openSUSE-SU-2020:1169

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.