CVE-2023-40547 Linux Shim Bootloader

April 29, 2024

Summary

Shim is a bootloader that facilitates the Secure Boot process on computers using Unified Extensible Firmware Interface. The bug involves trusting the remote server’s HTTP headers while booting over HTTP, which might allow an out-of-bounds write, and privileged code execution.[1][2]

There are three potential exploitation paths:

  1. Remote attackers can intercept HTTP traffic when an HTTP boot is attempted

  2. Attackers with physical access to the system can modify EFI settings using a live Linux USB to load a compromised shim bootloader

  3. Attackers on the local network can use PXE to load a compromised shim bootloader

Impact

The attack might allow a remote or local attacker to execute privileged code before the operating system is loaded on the system, giving the attacker a means to persist on the system even after the operating system has been reinstalled.

Vulnerable

Linux distributions that use Shim, including RedHat[3], Debian[4], Ubuntu[5], and SUSE[6], but which have not been patched to version 15.8, are vulnerable. Version 15.8 has been released but is not yet available through the Linux distributions’ patch process yet.

Recommendations

  1. Do not boot a network image over HTTP from an untrusted host until this vulnerability is patched.

  2.  Install the patched version of Shim (v15.8) from the vendor as soon as it is available.

  3. Linux users must also revoke the vulnerable versions of Shim by running fwupdmgr update (requires fwupd).

References

  1. https://www.bleepingcomputer.com/news/security/critical-flaw-in-shim-bootloader-impacts-major-linux-distros/

  2. https://eclypsium.com/blog/the-real-shim-shady-how-cve-2023-40547-impacts-most-linux-systems/

  3. https://access.redhat.com/security/cve/cve-2023-40547

  4. https://security-tracker.debian.org/tracker/CVE-2023-40547

  5. https://ubuntu.com/security/CVE-2023-40547

  6. https://www.suse.com/security/cve/CVE-2023-40547.html