TL;DR
This paper presents DICE, a formally verified implementation of the DICE measured boot protocol. By leveraging advanced verification tools and techniques, DICE guarantees memory safety, functional correctness, and resistance to side-channel attacks, offering a more secure and trustworthy foundation for device boot processes.
What Problem Does This Paper Address?
Securing the boot process of electronic devices is critical, as it's the initial stage where traditional security measures are not yet active. Traditional "authenticated boot" ensures that only authorized firmware can run, but it's vulnerable to attacks like booting with older, vulnerable firmware versions. "Measured boot" addresses this by measuring each firmware layer and recording these measurements for verification, allowing devices to attest to their integrity. However, implementing measured boot securely, especially on low-cost devices, is challenging. The Device Identifier Composition Engine (DICE) architecture offers a hardware-assisted, low-cost solution, but its complex cryptographic operations and reliance on low-level code make robust, bug-free implementations difficult to achieve. Defects in these implementations can have severe security implications, and fixing them post-deployment is often impossible or prohibitively expensive.
Methods
The authors developed DICE using a formal verification toolchain centered around F and its restricted subset, Low*. This approach allows for the specification and verification of low-level C code. Key techniques include:
- Formal Specification: Defining precise, mathematically rigorous specifications for the DICE engine and the Layer 0 (L0) firmware.
- Verified Implementation: Writing the actual code in Low*, which can be extracted to efficient, readable C code, while ensuring it adheres to the formal specifications.
- Memory Safety: Proving that the implementation is free from common memory errors like buffer overflows and null pointer dereferences.
- Functional Correctness: Guaranteeing that the code performs its intended cryptographic operations (key derivation, certificate generation) accurately.
- Side-Channel Resistance: Ensuring that the execution flow and memory access patterns are independent of secret values, thus protecting against timing and cache-based attacks.
- Platform-Agnostic Interface: Designing an abstract interface for the DICE engine to separate platform-specific details from the core logic, promoting reusability and simplifying verification.
- Custom Verified X.509 Library: Building a specialized, formally verified library for generating X.509 certificates and Certificate Signing Requests (CSRs) using the LowParse framework. This library is crucial for DICE's attestation capabilities.
- Proof Decomposition and Meta-programming: Employing advanced verification techniques to manage the complexity of proving properties for intricate functions, breaking down large proof obligations into smaller lemmas and using meta-programming to automate parts of the proof process.
Datasets
Not discussed in the paper.
Key Insights and Ideas
- Formal Verification is Feasible for Complex Embedded Systems: The paper demonstrates that it's possible to formally verify critical security components like a measured boot protocol, even with complex cryptographic operations and low-level code.
- Abstraction is Key to Managing Verification Complexity: Separating platform-agnostic logic from platform-specific implementations significantly simplifies the verification effort and promotes code reuse.
- Custom Verified Libraries are Essential: Relying on general-purpose, unverified cryptographic or ASN.1 libraries for security-critical components is risky. Building custom, formally verified libraries (like their X.509 library) is a more secure approach.
- Side-Channel Resistance is Achievable: By modeling secrets as abstract, constant-time types and enforcing specific coding disciplines, the implementation achieves resistance to timing and cache-based attacks.
- Minimal Performance Overhead: The verified implementation has a negligible impact on code size and boot time compared to an unverified counterpart, dispelling concerns about performance penalties for formal verification.
Key Results
- Formally Verified DICE Engine and L0: The paper presents DICE*, a formally verified implementation of the DICE engine and L0 firmware.
- Guaranteed Properties: DICE* is proven to be memory-safe, functionally correct, secure, and resistant to timing and cache-based side-channel attacks.
- Minimal Performance Impact: Integration into an STM32H753ZI microcontroller showed minimal to no effect on code size and boot time compared to an unverified implementation. For example, the DICE engine layer had a boot time of 689ms for DICE* versus 786ms for the unverified version, and LO had 208ms versus 313ms, respectively. Binary sizes were comparable (72KB vs. 68KB for the engine, and 92KB vs. 92KB for LO).
- Verified X.509 Library: A custom, formally verified X.509 certificate creation library was developed, extending LowParse with backward serializer support.
Limitations and Future Work
- Trusted Computing Base (TCB): The TCB includes the Low toolchain, F typechecker, Z3 SMT solver, KreMLin compiler, and native platform-specific implementations of hardware functions, the bootloader, I/O drivers, and declassification routines. The security guarantees extend only up to the compiled C code.
- Declassification: Public data (keys, signatures) derived from secrets requires explicit declassification, which is modeled as a trusted function. While the paper argues that verification failures would catch incorrect declassifications, manual auditing of these routines is still necessary.
- Hardware-Specific Aspects: Certain aspects of the DICE engine (e.g., UDS access, memory erasure) are inherently platform-specific. The paper provides a model implementation of the platform-agnostic interface but relies on native, platform-specific code for these parts, which becomes part of the TCB.
- Future Work: The authors suggest extending DICE* to further improve measured boot security by verifying hardware protection mechanisms underlying the DICE architecture and by verifying commonly used components in L0 firmware, such as attestation and key exchange protocols. They also mention that their X.509 library could be extended to support more datatypes and encodings.
Summary updated