Information about 8 vulnerabilities in the GRUB2 bootloader has been revealed, allowing bypassing the UEFI Secure Boot mechanism and enabling the execution of unverified code, such as introducing malware that operates at the bootloader or kernel level.
Recall that in most Linux distributions, a small shim layer, certified by Microsoft's digital signature, is used for verified loading in UEFI Secure Boot mode. This layer verifies GRUB2 with its own certificate, allowing distribution developers not to certify every kernel and GRUB update with Microsoft. Vulnerabilities in GRUB2 allow code execution at the stage after successful verification of the shim, but before the operating system loads, inserting itself into the trust chain while Secure Boot is active and gaining full control over the subsequent boot process, including loading another OS, modifying operating system components, and bypassing Lockdown protection.
As with last year's BootHole vulnerability, it is insufficient to just update the bootloader to block the problem, as an attacker, regardless of the operating system used, can compromise UEFI Secure Boot using a bootable medium with an old vulnerable version of GRUB2, certified by a digital signature. The issue can only be resolved by updating the list of revoked certificates (dbx, UEFI Revocation List), but in this case, the ability to use old installation media with Linux will be lost.
On systems with firmware that has updated the list of revoked certificates, in UEFI Secure Boot mode, only updated builds of Linux distributions will be able to load. Distributions will need to update their installers, bootloaders, kernel packages, fwupd firmware, and the shim layer, generating new digital signatures for them. Users will have to update installation images and other boot media, as well as load the list of revoked certificates (dbx) into the UEFI firmware. Until the dbx is updated in UEFI, the system remains vulnerable regardless of updates installed in the OS. The status of vulnerability remediation can be assessed on these pages: Ubuntu, SUSE, RHEL, Debian.
För att ÄtgÀrda problem som uppstÄr vid spridning av Äterkallade certifikat planeras det att i framtiden anvÀnda mekanismen SBAT (UEFI Secure Boot Advanced Targeting), vars stöd har implementerats för GRUB2, shim och fwupd, och som frÄn och med de kommande uppdateringarna kommer att anvÀndas istÀllet för funktionaliteten som tillhandahÄlls av paketet dbxtool. SBAT har utvecklats i samarbete med Microsoft och innebÀr att nya metadata, som inkluderar information om tillverkare, produkt, komponent och version, lÀggs till i exekverbara filer av UEFI-komponenter. De angivna metadatan signerades digitalt och kan dessutom inkluderas i listor över godkÀnda eller blockerade komponenter för UEFI Secure Boot. PÄ sÄ sÀtt kommer SBAT att möjliggöra manipulation av versionsnummer för komponenter vid en Äterkallelse, utan behov av att regenerera nycklar för Secure Boot och utan att skapa nya signaturer för kÀrnan, shim, grub2 och fwupd.
UpptÀckta sÄrbarheter:
- CVE-2020-14372 â med hjĂ€lp av kommandot acpi i GRUB2 kan en privilegierad lokal anvĂ€ndare ladda upp modifierade ACPI-tabeller genom att placera SSDT (Secondary System Description Table) i katalogen /boot/efi och Ă€ndra instĂ€llningar i grub.cfg. Trots att Secure Boot-lĂ€get Ă€r aktiverat kommer den föreslagna SSDT att utföras av kĂ€rnan och kan anvĂ€ndas för att inaktivera LockDown-skyddet, som blockerar vĂ€gar för att kringgĂ„ UEFI Secure Boot. Som ett resultat kan en angripare fĂ„ sin kĂ€rnmodul att laddas eller köra kod via mekanismen kexec, utan att den digitala signaturen kontrolleras.
- CVE-2020-25632 â Ă„tkomst till redan frigjord minnesomrĂ„de (use-after-free) i implementeringen av kommandot rmmod, vilket manifesteras vid försök att avlasta valfri modul utan att ta hĂ€nsyn till dess beroenden. SĂ„rbarheten utesluter inte skapandet av en exploatering som kan leda till kodexekvering utan att kontrolleras av Secure Boot.
- CVE-2020-25647 â skrivning utanför bufferten i funktionen grub_usb_device_initialize(), som anropas vid initiering av USB-enheter. Problemet kan utnyttjas genom att ansluta en speciellt förberedd USB-enhet som returnerar parametrar vars storlek inte överensstĂ€mmer med storleken pĂ„ den minnesbuffert som tilldelats för USB-strukturer. En angripare kan uppnĂ„ exekvering av kod som inte verifierats i Secure Boot genom manipulation med USB-enheter.
- CVE-2020-27749 â buffer overflow in the function grub_parser_split_cmdline(), which can be triggered by specifying GRUB2 variables larger than 1 KB in the command line. This vulnerability allows for code execution bypassing Secure Boot.
- CVE-2020-27779 â the cutmem command allows an attacker to remove a range of addresses from memory to bypass Secure Boot.
- CVE-2021-3418 â changes in shim_lock created an additional vector for exploiting last year's vulnerability CVE-2020-15705. When installing the dbx certificate used for signing GRUB2, GRUB2 allowed loading any kernel directly without signature verification.
- CVE-2021-20225 â potential for writing data beyond the buffer when executing commands with a very large number of options.
- CVE-2021-20233 â the possibility of writing data out of bounds due to incorrect buffer size calculation when using quotes. The calculation assumed that three characters were required to escape a single quote, while in reality four are needed.
KĂ€lla: opennet.ru
