Abstract
Boot firmware, like UEFI-compliant firmware, has been the target of numerous attacks, giving the attacker control over the entire system while being undetected. The measured boot mechanism of a computer platform ensures its integrity by using cryptographic measurements to detect such attacks. This is typically performed by relying on a Trusted Platform Module (TPM). Recent work, however, shows that vendors do not respect the specifications that have been devised to ensure the integrity of the firmware's loading process. As a result, attackers may bypass such measurement mechanisms and successfully load a modified firmware image while remaining unnoticed. In this paper we introduce BootKeeper, a static analysis approach verifying a set of key security properties on boot firmware images before deployment, to ensure the integrity of the measured boot process. We evaluate BootKeeper against several attacks on common boot firmware implementations and demonstrate its applicability.
Introduction
The boot firmware is the first code to execute when a computer powers on, establishing the foundation for the entire system's security. Modern systems rely on a "measured boot" process to ensure this firmware hasn't been tampered with. This process involves a Root of Trust, specifically the Static Core Root of Trust for Measurement (SCRTM), which hashes the firmware components and records these "fingerprints" in a Trusted Platform Module (TPM). However, if the SCRTM itself is compromised or if the implementation is flawed, the entire chain of trust is broken.
The Measured Boot Challenge
The UEFI Platform Initialization (PI) process consists of several phases, from Security (SEC) to Runtime (RT). The SCRTM typically encompasses the earliest phases, responsible for measuring subsequent stages to establish the Static Root of Trust for Measurement (SRTM).
A significant vulnerability arises if an attacker can manipulate the SCRTM. For instance, in a "tick" attack, a small piece of malicious code can patch the SCRTM to report a "golden" (legitimate) measurement to the TPM, even if the rest of the firmware has been modified. This allows malicious firmware to execute while the TPM reports a clean state, effectively bypassing the integrity check.
Methodology: The BootKeeper Pipeline
BootKeeper is a static analysis tool designed to verify firmware integrity without requiring source code. It utilizes the angr binary analysis framework to perform the following steps:
- TPM Write Detection: Using symbolic execution, BootKeeper identifies instructions that interact with the TPM's memory-mapped I/O (MMIO) space, specifically at the standard address
0xFED40000. - Hash Function Identification: Once a TPM write is located, the tool performs backward slicing to identify the cryptographic functions (e.g., SHA-1) that generated the data.
- Authenticity Verification: To prevent the use of "fake" hash functions, BootKeeper employs Data Flow Graph (DFG) isomorphism. It compares the firmware's hash implementation against known-good cryptographic libraries.
- Completeness and Atomicity:
- Completeness: It ensures that every reachable byte of code in the Control-Flow Graph (CFG) is included in the measurement.
- Atomicity: It verifies that the measurement is not tampered with between its calculation and its transmission to the TPM.
Evaluation and Results
The researchers evaluated BootKeeper on SeaBIOS, EDK II (TianoCore), and custom malicious firmware images designed to replicate known attacks.
- Detection Performance: BootKeeper successfully identified TPM writes in 80% of cases. The remaining 20% failed due to "path explosion" in unoptimized code, a common challenge for symbolic execution.
- Security Efficacy: The tool successfully detected all variants of the "tick" and "flea" attacks, identifying instances where hash functions were tampered with or code regions were left unmeasured.
- Efficiency: The analysis is remarkably fast, averaging 1 minute and 48 seconds per image with a memory footprint of approximately 522 MB, making it suitable for integration into firmware development and deployment pipelines.
Conclusion
BootKeeper demonstrates that binary-level static analysis can effectively bridge the gap in the hardware-software chain of trust. By validating the integrity of the measured boot process before deployment, it provides a crucial defense against persistent firmware-level threats that would otherwise remain invisible to traditional security software.
Summary updated