Kwetsbaarheden in GRUB2, waardoor UEFI Secure Boot kan worden omzeild

In de GRUB2-bootloader zijn 7 kwetsbaarheden verholpen die de UEFI Secure Boot-mechanisme konden omzeilen en zo de uitvoering van niet-geverifieerde code mogelijk maakten, zoals het inbrengen van malware die op het niveau van de bootloader of kernel opereert. Daarnaast is er één kwetsbaarheid in de shim-laag opgemerkt, die ook de UEFI Secure Boot kan omzeilen. De groep kwetsbaarheden heeft de codenaam Boothole 3 gekregen, analogie met soortgelijke problemen die eerder in de bootloader zijn vastgesteld.

Om de problemen in GRUB2 en shim aan te pakken, kunnen distributies het SBAT-mechanisme (UEFI Secure Boot Advanced Targeting) gebruiken, dat is geïmplementeerd voor GRUB2, shim en fwupd. SBAT is ontwikkeld in samenwerking met Microsoft en houdt in dat extra metadata aan de uitvoerbare bestanden van UEFI-componenten worden toegevoegd, die informatie bevatten over de fabrikant, het product, de component en de versie. Deze metadata worden digitaal ondertekend en kunnen afzonderlijk worden opgenomen in lijsten van goedgekeurde of geblokkeerde componenten voor UEFI Secure Boot.

In most Linux distributions, a small shim layer, certified by a digital signature from Microsoft, is used for verified boot 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 achieving code execution at the point after successful verification of the shim but before the operating system is loaded, inserting into the trust chain during active Secure Boot mode and gaining full control over the further boot process, including booting another OS, modifying operating system components, and bypassing Lockdown protection.

Om de problemen in de bootloader op te lossen, moeten distributies nieuwe interne digitale handtekeningen genereren en de installers, bootloaders, kernpakketten, fwupd-firmware en shim-laag bijwerken. Tot de invoering van SBAT was het bijwerken van de lijst met ingetrokken certificaten (dbx, UEFI Revocation List) een vereiste voor volledige blokkering van de kwetsbaarheid, omdat een aanvaller, ongeacht het gebruikte besturingssysteem, een opstartmedium met een oude kwetsbare versie van GRUB2, ondertekend met een digitale handtekening, kon gebruiken om UEFI Secure Boot te compromitteren.

In plaats van handtekeningen in te trekken, stelt SBAT in staat om het gebruik ervan te blokkeren voor specifieke versienummers van componenten zonder dat het nodig is om de sleutels voor Secure Boot in te trekken. Het blokkeren van kwetsbaarheden via SBAT vereist geen gebruik van de lijst met ingetrokken UEFI-certificaten (dbx), maar vindt plaats op het niveau van de vervanging van de interne sleutel voor het genereren van handtekeningen en het bijwerken van GRUB2, shim en andere opstartartefacten die door distributies worden geleverd. Momenteel is de ondersteuning voor SBAT al toegevoegd aan de meeste populaire Linux-distributies.

Geïdentificeerde kwetsbaarheden:

  • CVE-2021-3696, CVE-2021-3695 - buffer overflow in the heap when processing specially crafted PNG images, which can theoretically be exploited to execute attacker's code and bypass UEFI Secure Boot. It is noted that the issue is hard to exploit, as creating a working exploit requires taking numerous factors into account and having knowledge of memory layout.
  • CVE-2021-3697 - buffer underflow in the code processing JPEG images. Exploiting this issue requires knowledge of the memory layout and is about as complex as the PNG issue (CVSS 7.5).
  • CVE-2022-28733 — integer overflow in the function grub_net_recv_ip4_packets(), allowing influence over the parameter rsm->total_len via sending specially crafted IP packets. The issue is noted as the most dangerous of the presented vulnerabilities (CVSS 8.1). Successful exploitation allows writing data outside the buffer through allocating deliberately smaller memory size.
  • CVE-2022-28734 — one-byte buffer overflow when processing fragmented HTTP headers. The problem may lead to corruption of GRUB2 metadata (writing a null byte immediately after the end of the buffer) when parsing specially crafted HTTP requests.
  • CVE-2022-28735 — an issue in the shim_lock verifier allowing loading files not related to the kernel. The vulnerability can be used to load unsigned kernel modules or unverified code in UEFI Secure Boot mode.
  • CVE-2022-28736 — access to a previously freed memory area in the function grub_cmd_chainloader() through re-running the chainloader command used to boot operating systems not supported in GRUB2. Exploitation may lead to the execution of the attacker's code if the attacker can identify the memory allocation features in GRUB2.
  • CVE-2022-28737 — buffer overflow in the shim layer occurring in the function handle_image() when loading and executing specially crafted EFI images.

Bron: opennet.ru

Koop betrouwbare webhosting met bescherming tegen DDoS, VPS VDS servers 🔥 Koop betrouwbare webhosting met bescherming tegen DDoS, VPS VDS servers | ProHoster