Getting past Secure Boot
LogoFAIL: Firmware Image Parser Exploits, Traces and Checks
LogoFAIL flaws in UEFI boot logo parsers let a crafted image run code during boot, past Secure Boot; Bootkitty used one to enroll its key. Exposure and fixes.
- Goal
- Getting past Secure Boot
- Layer
- Firmware
- Where it acts
- UEFI variablesEFI system partitionOn the boot chain map
- Platforms
- Firmware
- Also known as
- LogoFAIL
- Used by
- Bootkitty
- Checked by
- None: no module reads its traces
Overview
Most PCs show the manufacturer's logo while the firmware starts. Drawing it means decoding an image file (BMP, PNG, JPEG, GIF and others) with a parser that runs inside the firmware during the DXE phase, with full control of the machine, before any boot loader and before Secure Boot has checked anything. In December 2023 Binarly presented LogoFAIL at Black Hat Europe: a set of flaws in those parsers, in firmware from the three main independent BIOS vendors, AMI, Insyde and Phoenix. A crafted image can make the parser write attacker data where it should not, and run attacker code during the DXE phase.
This page covers the technique of using such a flaw: plant a malformed logo where the firmware will read it, and let the firmware run the attacker's code at the next boot. It works at the firmware layer without changing the firmware's code. The image is data, not a signed executable, so neither Secure Boot nor a hardware root of trust checks it. Binarly states that the flaws make "below-the-OS" defences such as Secure Boot, including Intel Boot Guard, ineffective.
The only known use by a catalogue family is Bootkitty, a proof of concept from 2024. CERT/CC lists firmware from AMI, Insyde, Phoenix, Intel and Fujitsu as affected for at least one of the CVEs, and many other manufacturers as unknown; the fix is the device manufacturer's firmware update.
How it works
Where a logo comes from decides who can plant one. From Binarly's research:
| Logo source | Who can change it | Covered by Boot Guard? |
|---|---|---|
| A firmware volume in the SPI flash (the default) | Only someone who can write the flash and pass its verification | Often, when the volume is in the verified range |
A fixed path on the EFI system partition (ESP), for example \EFI\OEM\Logo.jpg | Anyone with administrator or root rights | No: it is a file on the disk |
| An NVRAM variable holding an ESP path, or the image itself | Code that can set that variable, from the OS where the vendor allows it | No |
| A logo in a firmware capsule, installed with vendor tools from the OS | Anyone who can run those tools | Depends on the capsule's checks |
Binarly found these customisation paths in firmware from several manufacturers; CERT/CC describes the ESP as the place the boot logo is read from and notes that it is protected from unprivileged access. An attacker therefore needs privileged access to the running system, or physical access, but no firmware write.
The CVEs, at summary level:
| CVE | Vendor and component | Summary |
|---|---|---|
| CVE-2023-40238 | Insyde InsydeH2O, BmpDecoderDxe | Crafted BMP logos can copy data to a specific address during DXE, through an integer signedness error in RLE4/RLE8 decoding; fixed in kernel 5.2 to 5.6 builds listed in Insyde's advisory |
| CVE-2023-39538, CVE-2023-39539 | AMI Aptio V | A user with local access can supply a malicious BMP or PNG logo |
| CVE-2023-5058 | Phoenix SecureCore Technology 4 | Improper input validation of a user-supplied splash screen; denial of service or code execution |
What happens after the code runs depends on the attacker. Code in DXE can change UEFI variables, add a key, or load anything else, before Secure Boot checks the boot loader. The firmware code in the flash does not change. Binarly notes that a bootkit can persist through the modified logo on the ESP or in a firmware capsule; in Bootkitty's case, the lasting effect was the key the exploit wrote to MokList.
How families use it
| Family | Use | Source |
|---|---|---|
| Bootkitty | A file named logofail.bmp (16 MB) was found with the Bootkitty samples. Binarly showed that it exploits CVE-2023-40238 in Insyde's BMP decoder, and that its shellcode writes the bootkit's certificate into shim's MokList, so shim trusts the self-signed bootkit with Secure Boot on (enrolling an attacker key in shim's MOK list). The shellcode restores the decoder's original code afterwards. Binarly names affected models from Acer, HP, Fujitsu and Lenovo, and notes that the exploit seems tailored to particular hardware | Binarly |
ESET's own Bootkitty report does not mention LogoFAIL; the link comes from Binarly's analysis of the file. Neither report says where the image would sit on a target machine. ESET and Binarly later reported that Bootkitty was written as a project in Korea's Best of the Best training programme; the reports cited here describe no use of LogoFAIL in a real attack.
Traces it leaves
| Where | What | Source |
|---|---|---|
| ESP | A logo image in an OEM logo path, unusually large or malformed (Bootkitty's was 16 MB, with abnormal dimensions in its header) | Binarly |
| NVRAM | A vendor logo variable holding an image or a path; and whatever the shellcode wrote (for Bootkitty, an extra certificate in MokList) | Binarly |
| Firmware capsule | A logo inside a capsule flashed from the OS | Binarly |
| SPI flash | Nothing, in the Bootkitty case: the vulnerable decoder is the vendor's, unchanged | Binarly |
| Memory | Nothing durable: Bootkitty's shellcode restored the patched decoder code | Binarly |
| What follows | The bootkit or implant the exploit enabled, on the ESP or in the OS | ESET |
How to check a host
Exposure. This is the main check. Note the board or model and the BIOS version (Get-CimInstance Win32_BIOS on Windows, sudo dmidecode -t bios on Linux), then read the manufacturer's LogoFAIL advisory for that model: Insyde's SA-2023053, AMI's AMI-SA-2023009, Phoenix's CVE-2023-5058 notice, and the OEM advisories they lead to. CERT/CC's VU#811862 lists vendor status. If the installed version predates the fix, the device is exposed.
Compromise. Look for what the exploit needs and what it leaves:
- on the ESP, image files under OEM folders, and their size and time compared with what the manufacturer installs;
- the logo customisation setting or variables the manufacturer documents;
- what the exploit enabled:
mokutil --list-enrolledfor an unknown MOK certificate, the ESP for a self-signed loader, the boot files for the bootkit.
What these cannot prove: a firmware version later than the fix shows exposure was closed, not that it was never used before. An image file on the ESP is not malicious by itself, and the reports give no general signature for a malicious logo. The exploit runs and cleans up during boot, so a live system shows only its results.
What the checker looks for
None of the checker's modules can detect a LogoFAIL exploit, so checks is empty for this technique. The flaw is in firmware code, and the checker does not parse images or read NVRAM.
esplists every file on the partition with its size, time and hash. An image under\EFI\is listed without a finding; one outside the folders boot loaders use raises "An unexpected file on the EFI system partition", a low finding. Neither says anything about the image's contents.- What the exploit leads to can show up: for Bootkitty,
espraises "A self-signed signature on"\EFI\ubuntu\grubx64.efiwhen its certificate is itself self-signed, andmeasuredbootrecords the Secure Boot state and boot applications. - The checker cannot tell whether the firmware is vulnerable; that is the manufacturer's advisory and update.
Mitigation and recovery
Prevent:
- install the manufacturer's firmware update that fixes the parser. Binarly confirmed that Insyde's patch stops the Bootkitty exploit, but also that LogoFAIL remained unpatched on hundreds of devices a year after disclosure: a fix reaches a machine only through its manufacturer's update;
- set a firmware administrator password;
- limit administrator and root rights, which writing to the ESP or to logo variables needs;
- watch MOK lists and ESP contents for changes.
Recover:
- Preserve the ESP image, the logo files and variables, and the
mokutiloutput. - Update the firmware first, so the same image cannot run again.
- Remove the planted image and restore the manufacturer's logo settings.
- Undo what the exploit did: remove unknown MOK certificates (
mokutil --deleteor--reset, confirmed at the console), rebuild the ESP and reinstall the operating system.
Sources
Primary public reports, newest first.
- 2024-11-29LogoFAIL Exploited to Deploy Bootkitty, the first UEFI bootkit for LinuxBinarly
- 2024-11-27Bootkitty: Analyzing the first UEFI bootkit for LinuxESET
- 2023-12-07CVE-2023-40238 (LogoFAIL in Insyde BmpDecoderDxe)NVD
- 2023-12-06LogoFAIL: Image files in UEFI can be abused to modify boot behavior (VU#811862)CERT/CC
- 2023-12-06Finding LogoFAIL: The Dangers of Image Parsing During System BootBinarly
See also
Related techniques
- Enrolling an attacker key in shim's MOK listGetting past Secure Boot
- Rollback to a vulnerable signed boot managerGetting past Secure Boot
- Adding a DXE driver to the firmwarePersisting in the boot chain
Families that use it
- BootkittyUEFI bootkit