TL;DR
System M is a novel program logic that formally verifies security properties for systems running untrusted code. By internalizing two real-world security patterns—sandboxing and code identification—into a formal type system, it allows researchers to prove that a system remains secure even when executing unknown, potentially malicious code provided by an adversary.
What Problem Does This Paper Address?
Modern software—from web browsers running JavaScript to hypervisors managing guest OSs—constantly executes code from untrusted sources. To keep these systems secure, developers rely on two main strategies:
- Sandboxing: Restricting the untrusted code to a narrow set of safe interfaces.
- Code Identification: Using mechanisms like digital signatures or Trusted Platform Modules (TPMs) to verify that the code being run is exactly what was expected.
While these mechanisms are common, formally proving that they actually guarantee security is incredibly difficult. Traditional program logics usually require the source code to be available and well-behaved for analysis. They struggle with "adversarial" scenarios where the code is unknown at design time or is intentionally trying to subvert the system. System M bridges this gap by providing a formal framework to reason about these "black-box" execution environments.
Methods
System M builds upon Hoare Type Theory (HTT), which combines the expressive power of dependent types with Hoare logic for reasoning about side effects. The authors introduce three major innovations:
- Trace-Based Safety Invariants: Unlike standard HTT, which focuses on the starting and ending states of a heap, System M uses predicates over the entire execution trace. This allows it to verify "safety properties"—things that must never happen at any point during execution, even if the program crashes or loops forever.
- The
CONFINERule: This is the formalization of sandboxing. It allows a programmer to assign a type to an unknown piece of code based solely on the interfaces it is allowed to call. If every interface in the sandbox preserves a security invariant, System M can prove the untrusted code will also preserve that invariant, regardless of its actual implementation. - The
EQRule: This internalizes code identification. If a system performs a check (like a cryptographic hash) to ensure that an unknown piece of code $e'$ is syntactically identical to a known, trusted piece of code $e$, theEQrule allows the logic to "transfer" the trusted code's type and properties to the untrusted one.
The syntax for these expressions and computations is detailed in Figure 1: Figure 1. Term Syntax
To ensure these rules are mathematically sound, the authors developed a step-indexed trace-based semantic model. This model accounts for concurrent execution, meaning the proofs hold even if an adversary is running other threads in parallel to interfere with the system.
Datasets
As a theoretical paper in programming languages and formal methods, System M does not use traditional datasets. Instead, its "benchmark" is the formal verification of Memoir, a real-world trusted computing system designed to prevent "rollback attacks" (where an attacker forces a service to revert to an older, potentially vulnerable state).
Key Insights and Ideas
- Typing the Environment, Not the Code: The
CONFINErule represents a shift in perspective. Instead of needing to see the "malicious" code to prove it's safe, you prove that the "jail" (the sandbox) is strong enough that no occupant could ever escape. - Syntactic Identity as a Logical Fact: By treating syntactic equality ($e = e'$) as a first-class citizen in the logic, the authors can formally link low-level hardware operations (like TPM hashing) to high-level type safety.
- Robust Safety: The logic is designed for "robust safety," meaning properties proved in System M remain true even when the program is composed with an arbitrary, untrusted environment. This is captured in the small-step reduction semantics shown in Figure 2: Figure 2. Selected small-step reduction semantics of configurations
Key Results
- Soundness Proof: The authors successfully proved the soundness of System M against their semantic model, ensuring that any property verified in the logic actually holds during execution.
- Memoir Verification: They used System M to prove the "state continuity" property of Memoir. They demonstrated that even if an adversary provides the service code, the combination of TPM-backed code identification (
EQrule) and interface restrictions (CONFINErule) ensures the service can only access the most recent, valid state. - Expressiveness: The logic successfully handles higher-order functions (functions that take other functions as arguments), which is a common stumbling block for simpler security logics.
Limitations and Future Work
- Manual Proofs: Currently, proofs in System M are manual and require significant expertise in formal logic. The authors identify the development of automated tactics and proof-checkers as a critical next step.
- Liveness Properties: System M focuses on safety (bad things don't happen). It does not yet address liveness (good things eventually happen), which would be necessary to reason about denial-of-service attacks.
- Information Flow: While the logic handles integrity and state, it isn't specifically designed for confidentiality (preventing data leaks) via non-interference, though the authors suggest it could be extended in that direction.
Summary updated