TL;DR
This paper introduces ALVIE, a novel tool that bridges the gap between formal security proofs and real-world system vulnerabilities by using black-box automata learning. ALVIE automatically discovers new security flaws in the Sancus embedded security architecture, even in its latest, supposedly patched versions, and systematically re-discovers known ones.
What Problem Does This Paper Address?
The paper tackles a fundamental challenge in computer security: the disconnect between theoretical security guarantees (formal proofs) and the reality of implemented systems. While formal methods can irrefutably prove a system's security based on its model, real-world implementations often contain subtle bugs or deviations that attackers can exploit. This "gap" means that even a formally verified system might not be truly secure. The authors specifically focus on the Sancus embedded security architecture, which aims to provide secure enclaves, and highlight discrepancies found by Bognar et al. [1] between Sancus's formal model and its implementation. They aim to automate the discovery of such discrepancies.
Methods
The core of the paper is the ALVIE tool, which employs black-box active automata learning. This means ALVIE learns a model of the Sancus system by interacting with it without needing access to its source code. The process involves three phases:
- Specification Phase: Defining the security properties of interest, including the attacker's capabilities (e.g., ability to create enclaves, access timers, handle interrupts) and the trusted component's behavior. This is done using regular expressions to describe attacker actions and trusted code.
- Learning Phase: ALVIE uses a modified L# algorithm to interact with the Sancus system (or its simulator) and learn a finite-state Mealy machine that represents its observable behavior under specific attack scenarios. This phase is crucial for capturing the system's actual behavior, not just its intended model.
- Checking Phase: The learned models are compared to formally verify security properties, such as robust noninterference (ensuring sensitive information doesn't leak to an attacker). If discrepancies are found between models representing different secret inputs or attacker capabilities, ALVIE identifies them as potential vulnerabilities and generates "witness graphs" that illustrate the attack trace.
A key innovation is the focus on Preservation of Robust Noninterference (PRNI), which ensures that if a system is secure against a basic attacker, it remains secure against a more powerful one. This is achieved by learning models for both basic and advanced attackers and checking if their behaviors are equivalent.
Datasets
Not discussed in the paper. The authors use a specific version of the Sancus architecture (both original and latest commits) as their "System Under Learning" (SUL) and analyze its behavior. They do not train models on pre-existing datasets in the traditional machine learning sense.
Key Insights and Ideas
- Automating the "Gap Bridging": The paper demonstrates that automata learning can be effectively used to automatically bridge the gap between formal models and real implementations, moving beyond manual analysis.
- Discovering Undocumented Attacks: ALVIE found new security vulnerabilities in the latest Sancus commit that were not previously documented, highlighting the ongoing challenges in securing embedded systems.
- History of Fixes Validation: ALVIE was used to reconstruct the history of Sancus fixes, verifying that previously identified vulnerabilities were indeed patched and that no regressions occurred in subsequent commits.
- Witness Graphs for Clarity: The generated witness graphs provide a clear, visual representation of attack traces, making complex vulnerabilities understandable and reproducible.
- PRNI as a Stronger Security Notion: The focus on Preservation of Robust Noninterference provides a more robust security guarantee than simple noninterference, as it considers the impact of increasing attacker capabilities.
Key Results
- ALVIE successfully rediscovered most known attacks on Sancus previously identified by Bognar et al. [1].
- Crucially, ALVIE discovered two new undocumented attacks in the latest Sancus commit, even after the fixes for known issues were applied. These new attacks relate to CPU resets upon read/write violations (V-B8) and explicit CPU resets within the enclave (V-B9).
- The tool was able to analyze various Sancus commits, confirming the effectiveness of patches and detecting regressions.
- The learning and checking process for ALVIE was relatively efficient, taking about an hour for simpler specifications and a couple of days for more complex ones, enabling continuous verification.
- ALVIE can synthesize executable attack code from witness graphs, facilitating regression testing.
Limitations and Future Work
- Inability to Create Multiple Enclaves: ALVIE currently cannot handle the creation of multiple enclaves simultaneously, which prevented it from discovering one specific attack (V-B5) from Bognar et al. [1]. This is noted as an implementation issue to be addressed.
- Performance Bottlenecks: The performance of Verilator-generated simulators limited the complexity of attacker and enclave specifications. The authors plan to analyze a Sancus implementation on an FPGA for better performance.
- Scalability: While ALVIE is efficient for the current Sancus analysis, scaling to larger and more complex architectures remains a general challenge.
- Future Work: The authors plan to apply ALVIE to other case studies and explore more complex attacker/enclave specifications. They also aim to improve the performance of the Verilator simulator.
Summary updated