Vulnerabilities

CVE-2023-40547 - Linux shim bootloader vulnerability

This advisory is for organizations that use Linux distributions within their environment.  The advisory applies to a critical vulnerability in the Shim Linux bootloader and effects Linux variants that support Secure Boot.

Summary

Red Hat has pushed a code commit to fix a vulnerability in the code they maintain for the Shim bootloader which could be leveraged to execute code and/or take control of a target system before the kernel is loaded.

Shim was created to allow Linux distributions to boot on PCs leveraging UEFI Secure Boot.  Though it was developed by Red Hat, it is used by other distributions to allow their operating systems to load using certificates issued by their own companies (rather than Microsoft).  If interested: https://www.linux-magazine.com/Issues/2018/206/Linux-Secure-Boot-with-Shim)

This vulnerability resides in the part of Shim (httpboot.c) which supports booting an image from a central server on a network using HTTP.  One way this may be exploited is through an attacker positioning themselves between the victim and the HTTP server used to serve files that support the HTTP boot.  Shim allocates a buffer for the received data using the buffer size specified in the HTTP header.  The size in the header can be manipulated to reduce the size of the buffer resulting in a buffer overflow.  In other scenarios, the bug may be abused locally by malware that gains system privilege and overwrites the EFI partition, or from an adjacent network when PXE boot is enabled.

CVE-2023-40547 – Shim Buffer Overflow vulnerability

                CSVVv3.1: 9.8 (This CVSS is from the National Vulnerability Database.  Red Hat rates this with a score of 8.3)

 

Affected Platforms

Shim versions prior to v15.8

Mitigations

Track patch progress from the distributor of your Linux variant.  Links are provided below.

Additional Resources

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

Red Hat Code Commit: https://github.com/rhboot/shim/commit/0226b56513b2b8bd5fd281bce77c40c9bf07c66d

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

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

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

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