[Paper Review] When Good Components Go Bad: Formally Secure Compilation Despite Dynamic Compromise
This paper introduces a formal security criterion, RSCDC, for secure compilation in unsafe languages that ensures components remain protected from compromise—even after encountering undefined behavior. It proves that a compiler satisfying RSCDC guarantees that a dynamically compromised component cannot cause more harm at the target level than an attacker-controlled component with the same privileges could at the source level, using machine-checked Coq proofs and practical enforcement via software fault isolation or reference monitors.
We propose a new formal criterion for evaluating secure compilation schemes for unsafe languages, expressing end-to-end security guarantees for software components that may become compromised after encountering undefined behavior---for example, by accessing an array out of bounds. Our criterion is the first to model dynamic compromise in a system of mutually distrustful components with clearly specified privileges. It articulates how each component should be protected from all the others---in particular, from components that have encountered undefined behavior and become compromised. Each component receives secure compilation guarantees---in particular, its internal invariants are protected from compromised components---up to the point when this component itself becomes compromised, after which we assume an attacker can take complete control and use this component's privileges to attack other components. More precisely, a secure compilation chain must ensure that a dynamically compromised component cannot break the safety properties of the system at the target level any more than an arbitrary attacker-controlled component (with the same interface and privileges, but without undefined behaviors) already could at the source level. To illustrate the model, we construct a secure compilation chain for a small unsafe language with buffers, procedures, and components, targeting a simple abstract machine with built-in compartmentalization. We give a machine-checked proof in Coq that this compiler satisfies our secure compilation criterion. Finally, we show that the protection guarantees offered by the compartmentalized abstract machine can be achieved at the machine-code level using either software fault isolation or a tag-based reference monitor.
Motivation & Objective
- To formalize the security guarantees of secure compilation in systems with mutually distrustful components that may become compromised after undefined behavior.
- To define a criterion ensuring that a compromised component cannot cause greater harm at the target level than it could at the source level.
- To provide a machine-checked proof in Coq that a secure compilation chain satisfies the proposed RSCDC criterion.
- To demonstrate that compartmentalization-based protection can be achieved at the machine-code level using software fault isolation or tag-based reference monitors.
Proposed method
- Proposes RSCDC (Robust Safety Criteria for Dynamic Compromise) as a formal criterion for secure compilation in unsafe languages.
- Models dynamic compromise as a component becoming fully controlled by an attacker after encountering undefined behavior.
- Defines a class of safety properties ZP = Safety ∩ Closed≺P that are preserved under RSCDC, ensuring robustness against undefined behavior extensions.
- Constructs a secure compilation chain for a small unsafe language targeting a compartmentalized abstract machine with built-in isolation.
- Uses machine-checked proofs in Coq to formally verify that the compiler satisfies RSCDC.
- Demonstrates practical deployment of the protection model using software fault isolation or tag-based reference monitors at the machine-code level.
Experimental results
Research questions
- RQ1How can we formally define security guarantees for a compilation chain when components may become compromised due to undefined behavior?
- RQ2What properties must a secure compilation chain preserve to ensure that a compromised component cannot cause more harm at the target level than it could at the source level?
- RQ3Can the proposed RSCDC criterion be formally verified using machine-checked proofs in a proof assistant like Coq?
- RQ4How can the security guarantees of compartmentalization be enforced at the machine-code level using existing low-level mechanisms?
- RQ5What class of safety properties is preserved under RSCDC, and how can they be expressed in the source language to ensure target-level robustness?
Key findings
- The RSCDC criterion is formally defined and proven to be equivalent to preserving all properties in the class ZP = Safety ∩ Closed≺P.
- A secure compilation chain for a small unsafe language is formally verified in Coq to satisfy RSCDC, ensuring that dynamic compromise does not increase the attack surface beyond what is already possible at the source level.
- The paper shows that the security guarantees of compartmentalization can be achieved at the machine-code level using software fault isolation or tag-based reference monitors.
- The class ZP includes safety properties that are closed under extension with undefined behavior, ensuring that if a trace with undefined behavior is allowed, so are all its extensions.
- A stronger variant of a safety property S1, denoted SZ+P1, is defined and proven to be in ZP, showing that such properties can be made robust under RSCDC.
- For any safety property π not in ZP, a stronger variant πZ+P can be constructed that is in ZP and as permissive as possible, enabling RSCDC-based compilation to preserve desired safety guarantees.
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.