Távoli sebezhetőség a Shim rétegben, amely lehetővé teszi az UEFI Secure Boot megkerülését.

A Shim layer used in most Linux distributions for verified boot in UEFI Secure Boot mode has a vulnerability (CVE-2023-40547) that could allow remote code execution and bypass the UEFI Secure Boot mechanism. An attacker controlling the HTTP server that Shim accesses can return a specially crafted response, leading to controlled write operations outside the buffer area to execute code early in the boot process.

The vulnerability is caused by an error in the HTTP file loading code, which occurs when processing incorrect responses returned by the HTTP server accessed by Shim. The HTTPBoot mode in Shim has been supported since 2016 and allows network booting using the HTTP protocol to fetch the loader file invoked at the next stage. When loading files via HTTP, Shim allocates a buffer for incoming data based on the size specified in the 'Content-Length' HTTP header instead of the actual size of the data. Thus, returning a smaller value in the Content-Length header can lead to writing the tail of the request into memory outside the buffer.

Shim is digitally signed by Microsoft and verifies GRUB2 with its own certificate, allowing distribution developers to avoid signing every kernel and GRUB update with Microsoft. The vulnerability in Shim enables an intrusion into the trust chain during Secure Boot and provides full control over the subsequent boot process, for example, to boot another OS, modify operating system components, and bypass Lockdown protection.

The vulnerability has been fixed in Shim version 15.8, but to fully block the attack via Shim, the new version must be signed by Microsoft and integrated into the distributions. The status of vulnerability remediation in distributions can be evaluated on these pages: Debian, Ubuntu, SUSE, RHEL, Fedora. The issue is that without revoking the signature of the old version, the fix is meaningless, as an attacker could use a boot medium with a vulnerable Shim release to compromise UEFI Secure Boot. However, revoking the signature would prevent verified booting of distributions that continue to use the old version of Shim.

A sebezhetőség visszavonása nélküli blokkolásához a disztribúciók használhatják az SBAT mechanizmust (UEFI Secure Boot Advanced Targeting), amelynek támogatása a GRUB2-re, shim-re és fwupd-re a legtöbb népszerű Linux disztribúcióban megvalósult. Az SBAT-ot a Microsoft együttműködésével fejlesztették ki, és plusz metaadaták hozzáadását jelenti az UEFI komponensek végrehajtható fájljaihoz, amelyek tartalmazzák a gyártóról, termékről, komponensről és verzióról szóló információkat. Ezek a metaadatok digitális aláírással hitelesítettek, és külön-külön is szerepelhetnek az UEFI Secure Boot engedélyezett vagy tiltható komponenseinek listáján.

A SBAT lehetővé teszi a digitális aláírás használatának blokkolását a komponensek különböző verziószámaihoz anélkül, hogy szükség lenne a Secure Boot kulcsainak visszavonására. A sebezhetőségek SBAT általi blokkolása nem igényli az UEFI (dbx) visszavont tanúsítványainak listájának használatát, hanem a belső kulcs felváltásának szintjén történik az aláírások formálásához és a GRUB2, shim és egyéb biztosított disztribúciók által biztosított indító artefaktumok frissítéséhez.

A vizsgált sebezhetőségen kívül a Shim 15.8-ban számos, helyileg kihasználható, kevésbé veszélyes probléma is javításra került:

  • CVE-2023-40548 — egész számok overflow-ja a verify_sbat_section függvényben, ami 32 bites rendszereken puffertúlcsorduláshoz vezet.
  • CVE-2023-40546 — memória területről való olvasás a LogError() függvényen keresztüli hibaüzenetek megjelenítésekor.
  • CVE-2023-40549 — memória területről való olvasás a verify_buffer_authenticode() függvényben, egy kifejezetten PE formátumú fájl feldolgozása során.
  • CVE-2023-40550 — memória területről való olvasás a verify_buffer_sbat() függvényben.
  • CVE-2023-40551 — memória területről való olvasás MZ formátumú fájlok parszolása során.

Forrás: opennet.ru

Megbízható hosting vásárlása weboldalak számára, DDoS védelemmel, VPS VDS szerverek. 🔥 Megbízható webtárhely vásárlása DDoS védelemmel, VPS VDS szerverek | ProHoster