Bootkeeper: Validating Software Integrity Properties on Boot Firmware Images
Total Page:16
File Type:pdf, Size:1020Kb
Session 8: System Security and Authentication CODASPY ’19, March 25–27, 2019, Richardson, TX, USA BootKeeper: Validating Software Integrity Properties on Boot Firmware Images Ronny Chevalier Stefano Cristalli Christophe Hauser CentraleSupélec, Inria, Univ Rennes, Università degli Studi di Milano University of Southern California CNRS, IRISA [email protected] [email protected] [email protected] Yan Shoshitaishvili Ruoyu Wang Christopher Kruegel Arizona State University Arizona State University University of California, Santa [email protected] [email protected] Barbara [email protected] Giovanni Vigna Danilo Bruschi Andrea Lanzi University of California, Santa Università degli Studi di Milano Università degli Studi di Milano Barbara [email protected] [email protected] [email protected] ABSTRACT Boot Firmware Images. In Ninth ACM Conference on Data and Application Boot firmware, like UEFI-compliant firmware, has been the target Security and Privacy (CODASPY ’19), March 25–27, 2019, Richardson, TX, USA. of numerous attacks, giving the attacker control over the entire ACM, New York, NY, USA, 11 pages. https://doi.org/10.1145/3292006.3300026 system while being undetected. The measured boot mechanism of a computer platform ensures its integrity by using cryptographic 1 INTRODUCTION measurements to detect such attacks. This is typically performed by relying on a Trusted Platform Module (TPM). Recent work, however, One of the most critical components of every computer is the shows that vendors do not respect the specifications that have been boot firmware (e.g., BIOS or UEFI-compliant firmware), which isin devised to ensure the integrity of the firmware’s loading process. charge of initializing and testing the various hardware components, As a result, attackers may bypass such measurement mechanisms and then transfer execution to the Operating System (OS). As a and successfully load a modified firmware image while remaining result of its early execution, the boot firmware is a highly privileged unnoticed. In this paper we introduce BootKeeper, a static anal- program. Any malicious alteration of its behavior can have critical ysis approach verifying a set of key security properties on boot consequences on the entire system. An attacker that can control the firmware images before deployment, to ensure the integrity ofthe firmware can control any parts of the software and undermine the measured boot process. We evaluate BootKeeper against several at- security of the entire OS. Without any protection of the integrity tacks on common boot firmware implementations and demonstrate of the boot firmware, we cannot assure any security properties of its applicability. the software executing on the system. To guarantee the software integrity of the machine, the Trusted CCS CONCEPTS Computing Group (TCG), an industry coalition formed to imple- ment trusted computing concepts across personal computers, de- • Security and privacy → Systems security. signed a new set of hardware components, the aim of which is to solve various hardware-level trust issues. In their specification, KEYWORDS they define the TPM, which is composed of a co-processor that firmware, TPM, SCRTM, binary analysis offers cryptographic functions (e.g., SHA-1, RSA, random number ACM Reference Format: generator, or HMAC) and a tamper-resistant non-volatile mem- Ronny Chevalier, Stefano Cristalli, Christophe Hauser, Yan Shoshitaishvili, ory used for storing cryptographic keys [33]. The TPM along with Ruoyu Wang, Christopher Kruegel, Giovanni Vigna, Danilo Bruschi, and An- other software components together form a root of trust, which drea Lanzi. 2019. BootKeeper: Validating Software Integrity Properties on is leveraged as part of several security mechanisms, including the measured boot process. With measured boot, platforms with a TPM Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed can be configured to measure every component of the boot process, for profit or commercial advantage and that copies bear this notice and the full citation including the firmware, boot loader, and kernel. Such measurement on the first page. Copyrights for components of this work owned by others than ACM process is also called the Static Root of Trust for Measurement must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a (SRTM). fee. Request permissions from [email protected]. The core of trust of the entire process is established based on CODASPY ’19, March 25–27, 2019, Richardson, TX, USA the integrity of the first piece of code inside the boot firmware © 2019 Association for Computing Machinery. ACM ISBN 978-1-4503-6099-9/19/03...$15.00 which is doing the first measurements, also called the Static Core https://doi.org/10.1145/3292006.3300026 Root of Trust for Measurement (SCRTM) [41]. In the event where a 315 Session 8: System Security and Authentication CODASPY ’19, March 25–27, 2019, Richardson, TX, USA malicious modification of the SCRTM successfully hides from the efficacy of our approach. Our paper makes the following contribu- self-measurement technique, the whole chain of trust and, conse- tions: quently, the integrity of the entire system may be broken. In this • We devise a set of software properties that can be used for direction, Butterworth et al. [4] described different examples of validating the measurement process and mitigate firmware attacks against the SCRTM component. In particular, the authors attacks aimed to subvert the entire system. show how a novel “tick” malware, a 51-byte patch to the SCRTM, • We design and implement BootKeeper, a binary analysis can replay a forged measurement to the TPM, falsely indicating approach to detect and prevent measurement boot firmware that the BIOS is genuine. These attacks take advantage of the fact attacks in different attack scenarios. that some vendors do not measure the SCRTM code, thus allowing • We perform experimental evaluation against different at- an attacker to modify it and to forge measurements without being tacks and several boot firmware implementations to demon- detected. strate the effectiveness of our approach. Recent platforms incorporate an immutable, hardware protected SCRTM [11, 23]. Intel Boot Guard and HP Sure Start are immutable 2 BACKGROUND SCRTMs which measure and verify, at boot time, the integrity of the In this section, we introduce the background technology needed BIOS image before executing it. Such technologies are not directly to understand our approach. We first describe the principles of the vulnerable to the aforementioned attacks, since their code cannot TPM, then we describe the UEFI specifications and some of the be modified by an attacker.1 Both technologies, however, are only software/hardware components involved in the boot measurement available in recent Intel and HP platforms, leaving previous hard- process. ware implementations, or devices of other vendors, vulnerable against forged measurements. In such implementations, since the SCRTM is 2.1 Trusted Platform Module (TPM) not hardware protected, it is usually attached to the firmware image itself during the firmware update process. Even when the firmware The TPM specification defines a co-processor offering cryptographic image is signed, attacks may compromise this process [14], and features (e.g., SHA-1, RSA, random number generator, or HMAC), consequently allow an attacker to modify both the firmware code and tamper-resistant storage for cryptographic keys [33]. and the SCRTM. The TPM provides a minimum of 16 Platform Configuration In order to solve these challenges in validating the SCRTM code, Register (PCR) which are 160-bit wide registers used to store the we design a self-contained approach based on static analysis at the measurements done by the SCRTM (usually SHA-1 hashes). The de- binary level, which is able, starting from a boot firmware image, sign of these registers allows an unlimited amount of measurements to validate the correctness of the measurement process. Our sys- and prevents an attacker from overwriting them with arbitrary val- tem verifies software properties on the SCRTM code embedded ues. In order to do this, the only possible operation is extend: in firmware images, including: (1) the completeness of firmware PCRi = H¹PCRi jj mº code measurements in terms of fingerprinted memory regions, (2) the correctness of cryptographic functions implemented2 inside Where PCRi is the ith PCR register, H is the hash function and the SCRTM (e.g., SHA-1), and (3) the correctness of the SCRTM’s m the new measurement. The TPM concatenates each new measure- control flow. More in detail, the first property ensures that thecode ment sent with the previous value of the register, then it hashes of the entire firmware is measured correctly by the SCRTM, i.e., that the result, which becomes the new value of the register. This mech- none of the instructions to be executed at runtime will be missed anism is crucial to establishing a chain of trust, since the only way by the measurement process. The second property ensures that the to obtain a given measurement value from a PCR is to reproduce implementation of cryptographic functions inside the SCRTM is the same series of measurements in the same order. The measured correct. The third property validates the correctness of the measure- boot process relies on this mechanism to guarantee that a given ment operations performed by the SCRTM in terms of execution software platform is valid and has not been tampered with. order. It also guarantees the atomicity of operations occurring be- The TPM also relies on these measurements to provide specific tween memory fingerprinting and write operations performed on features (e.g., secure storage or remote attestation). For instance, the TPM component (i.e., ensuring that what is measured is what is with the sealing operation, the TPM offers the ability to encrypt data, written to the TPM).