BootKeeper: Validating Software Integrity Properties on Boot Firmware Images

Ronny Chevalier, Stefano Cristalli, Christophe Hauser, Yan Shoshitaishvili, Ruoyu Wang, Christopher Kruegel, Giovanni Vigna, Danilo Bruschi, Andrea Lanzi

TL;DR

BootKeeper is a static analysis tool designed to verify that boot firmware correctly implements the "measured boot" process. By analyzing firmware binaries, it ensures that all reachable code is measured and that the cryptographic fingerprints sent to the Trusted Platform Module (TPM) haven't been tampered with, effectively closing a critical gap in the hardware-software chain of trust.

What Problem Does This Paper Address?

When you turn on a computer, the boot firmware (like UEFI or BIOS) is the first code to run. To ensure this code hasn't been tampered with, modern systems use a "measured boot" process. This relies on a Root of Trust: a small piece of code called the Static Core Root of Trust for Measurement (SCRTM) hashes the firmware and sends that "fingerprint" to a secure hardware chip called the TPM.

The problem? If the SCRTM itself is buggy or malicious, the entire chain of trust collapses. Previous research has shown that attackers can use tiny "tick" malware (just 51 bytes!) to patch the SCRTM, forcing it to report a "golden" measurement to the TPM even if the rest of the firmware is infected. Furthermore, vendors often fail to measure the entire firmware, leaving "dark corners" where rootkits can hide undetected. BootKeeper aims to validate these firmware images before they are deployed.

Methods

BootKeeper uses a pipeline of advanced binary analysis techniques, primarily built on the angr framework, to evaluate firmware without needing access to the original source code. Its approach follows four main steps:

  1. TPM Write Detection: It uses symbolic execution to find instructions that interact with the TPM’s memory-mapped I/O (specifically the standard address 0xFED40000). This identifies exactly where the firmware "reports" its integrity.
  2. Hash Function Identification: Once a TPM write is found, the tool uses backward slicing to trace the data back to its source. It looks for the cryptographic functions (like SHA-1) used to generate the measurement.
  3. Authenticity Verification: To ensure an attacker hasn't substituted a fake hash function, BootKeeper uses Data Flow Graph (DFG) isomorphism. It compares the structure of the firmware's hash function against a database of known-good implementations (like OpenSSL).
  4. Completeness & Atomicity Checks:
    • Completeness: It builds a Control-Flow Graph (CFG) of the firmware to ensure that every reachable byte of code is actually included in the measurement.
  5. Atomicity: It verifies that the measurement isn't modified between the time it is calculated and the time it is written to the TPM (preventing "man-in-the-middle" attacks within the code itself).

Datasets

The authors evaluated BootKeeper on three types of firmware:

  • SeaBIOS: An open-source implementation of a 16-bit x86 BIOS.
  • EDK II (TianoCore): The industry-standard modern UEFI implementation used by major vendors like Intel and ARM.
  • Custom Malicious Firmware: The authors crafted specific images to reproduce known attacks, such as the "tick" and "flea" attacks, which attempt to forge measurements or hide code in unmeasured regions.

Key Insights and Ideas

  • The Binary is the Source of Truth: You don't need the vendor's source code to verify security properties. By looking at the raw binary, BootKeeper can catch compiler-introduced bugs or post-compilation tampering.
  • Atomicity Matters: A common "aha" moment in the paper is the realization that simply having a hash function isn't enough. If an attacker can change the pointer to the hash result just before it's sent to the TPM, the security is bypassed. BootKeeper’s symbolic execution specifically checks for this "time-of-check to time-of-use" style vulnerability.
  • Bridging Static and Dynamic: While BootKeeper is a static analysis tool, it uses symbolic execution (a "heavyweight" technique) to resolve complex, computed memory addresses that traditional static analysis would miss.

Key Results

  • Detection Accuracy: BootKeeper successfully identified TPM write operations in 80% of the tested cases. The failures were primarily in unoptimized code where "path explosion" (too many possible execution branches) timed out the analysis.
  • Attack Detection: It successfully detected all variants of the "tick" attack, flagging images where the hash function was tampered with or where malicious code was hidden in unmeasured memory blocks.
  • Performance: The analysis is practical for a security audit or a CI/CD pipeline, taking an average of 1 minute and 48 seconds and using roughly 522 MB of RAM to validate a firmware image.

Limitations and Future Work

  • Path Explosion: Like all tools relying on symbolic execution, BootKeeper struggles with highly complex, unoptimized code that creates a massive number of execution paths.
  • Indirect Jumps: If the firmware uses very complex logic to determine where to jump next (indirect branches), the static CFG recovery might miss some code paths, leading to potential false negatives.
  • Obfuscation: While the tool can handle standard compiler optimizations, intentional code obfuscation (used by some malware or DRM) could potentially hide malicious behavior from the analyzer.
  • Future Work: The authors suggest integrating dynamic analysis (emulation) to help resolve the "dark paths" that static analysis can't reach.

Summary updated

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.
BibTeX
@inproceedings{chevalier2019bootkeeper,
  author = {Ronny Chevalier and Stefano Cristalli and Christophe Hauser and Yan Shoshitaishvili and Ruoyu Wang and Christopher Kruegel and Giovanni Vigna and Danilo Bruschi and Andrea Lanzi},
  title = {{BootKeeper: Validating Software Integrity Properties on Boot Firmware Images}},
  booktitle = {CODASPY},
  year = {2019},
  url = {https://openreview.net/forum?id=Wttwv_dfuja},
}

Loading related content...

Figure