[Paper Review] Beyond Good and Evil: Formalizing the Security Guarantees of Compartmentalizing Compilation
This paper introduces Secure Compartmentalizing Compilation (SCC), a formal security property that extends full abstraction to compartmentalized systems, ensuring that attackers cannot subvert component isolation even when compromising individual components. The authors prove SCC for a compiler from an unsafe imperative language to a compartmentalized abstract machine, establishing formal guarantees for secure component interaction under a realistic attacker model.
Compartmentalization is good security-engineering practice. By breaking a large software system into mutually distrustful components that run with minimal privileges, restricting their interactions to conform to well-defined interfaces, we can limit the damage caused by low-level attacks such as control-flow hijacking. When used to defend against such attacks, compartmentalization is often implemented cooperatively by a compiler and a low-level compartmentalization mechanism. However, the formal guarantees provided by such compartmentalizing compilation have seen surprisingly little investigation. We propose a new security property, secure compartmentalizing compilation (SCC), that formally characterizes the guarantees provided by compartmentalizing compilation and clarifies its attacker model. We reconstruct our property by starting from the well-established notion of fully abstract compilation, then identifying and lifting three important limitations that make standard full abstraction unsuitable for compartmentalization. The connection to full abstraction allows us to prove SCC by adapting established proof techniques; we illustrate this with a compiler from a simple unsafe imperative language with procedures to a compartmentalized abstract machine.
Motivation & Objective
- To formalize the security guarantees provided by compartmentalizing compilation, which combines compiler transformations with low-level isolation mechanisms.
- To identify limitations of standard full abstraction in modeling compartmentalization and address them through a new security property.
- To provide a formal framework for reasoning about secure component interaction in unsafe languages, where memory safety is not guaranteed.
- To demonstrate the feasibility of SCC through a concrete compiler from an unsafe imperative language to a compartmentalized abstract machine.
- To lay foundations for extending SCC to realistic systems, including C compilers and real hardware enforcement mechanisms.
Proposed method
- The authors define Secure Compartmentalizing Compilation (SCC) as a refinement of full abstraction, tailored to compartmentalized systems with mutually distrustful components.
- They identify three key limitations of standard full abstraction in the context of compartmentalization: lack of component isolation, absence of privilege modeling, and failure to handle undefined behavior in source languages.
- SCC is formalized by extending the standard full abstraction property to account for component boundaries, privilege separation, and attacker capabilities within the source language.
- The proof technique adapts established methods from full abstraction, including logical relations and step-indexed models, to reason about component behavior under compromise.
- A prototype compiler from a simple unsafe imperative language with procedures is implemented and proven to satisfy SCC using Coq.
- The approach is designed to be extensible to real-world systems, including C compilers targeting tag-based reference monitors or process-level sandboxing.
Experimental results
Research questions
- RQ1How can full abstraction be adapted to formally capture the security guarantees of compartmentalizing compilation in the presence of memory-unsafe code?
- RQ2What are the key limitations of standard full abstraction when applied to compartmentalized systems with mutually distrustful components?
- RQ3Can a formal security property be defined that ensures attackers cannot escape component boundaries even when compromising individual components?
- RQ4How can undefined behavior in source languages be handled within a formal security model for compartmentalized compilation?
- RQ5What are the implications of extending SCC to realistic enforcement mechanisms such as process sandboxing, SFI, or capability machines?
Key findings
- The paper successfully defines Secure Compartmentalizing Compilation (SCC) as a formal security property that extends full abstraction to compartmentalized systems with mutual distrust.
- SCC formally captures the attacker model in which compromised components are limited to behaviors expressible in the source language, preventing privilege escalation across component boundaries.
- The authors prove that a compiler from an unsafe imperative language with procedures to a compartmentalized abstract machine satisfies SCC, demonstrating the feasibility of the approach.
- The proof relies on established techniques such as logical relations and step-indexing, adapted to handle component isolation and undefined behavior.
- The framework is extensible and can be applied to real-world systems, including C compilers targeting hardware-enforced compartmentalization mechanisms like tag-based reference monitors.
- The work opens the door to formal verification of secure compilation in practical systems, including web browsers and operating system components.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.