Weird Machines as Insecure Compilation
Reference: Jennifer Paykin, Eric Mertens, Mark Tullsen, Luke Maurer, Benoît Razet, Alexander Bakst, and Scott Moore. Weird Machines as Insecure Compilation. Supplied PDF (filename identifies the 2020 PriSC version; the document carries arXiv:1911.00157v1, dated 1 November 2019).
Summary
The paper gives weird machines a programming-language definition: an exploit is an attacker-controlled target-language context whose interaction with a compiled component produces behavior that no source-language context can reproduce, under a specified relation between source and target behaviors. A component’s weird machine is the collection of behaviors generated by these exploits. This replaces an informal picture of the programmer’s intended machine with explicit source semantics, target semantics, compilation, and attacker capabilities.
The framework connects exploit construction to failures of robust security-property preservation. Examples include SQL injection, Java access-control violations, return-oriented and data-oriented programming, and timing side channels. A toy compilation stack moves from an imperative language with naturals and booleans through a C-like language and assembly to hardware with observable timing. Each layer exposes different ways to break source abstractions. The authors also give conditions under which exploits propagate through multiple compilation stages, and provide PLT Redex models as arXiv ancillary files.
The definition deliberately measures observable behavior rather than the internal mechanism of an attack. Undefined behavior or an unusual execution path alone does not establish an exploit: another source context might reproduce the same observations. Consequently, the chosen source abstractions, observable behaviors, behavior relation, and attacker class determine what the framework detects. This is a formal account of abstraction-breaking behavior, rather than a universal catalogue of everything an operator would regard as harmful.
Key Ideas
- Exploit as a counterexample: For component
V, compilation ↓, and attacker A, an exploit exists when there is no source context C whose behavior for C[V] relates to that of A[V↓].
- Weird machine as behaviors: The machine consists of behaviors achievable by exploits of a particular component, relative to the selected attacker class and semantic model.
- Compilation includes representation changes: Structured queries becoming SQL strings illustrate how the framework applies beyond machine-code generation.
- Robust preservation: Security must survive interaction with arbitrary permitted contexts. Whole-program compiler correctness alone does not ensure this protection for components.
- Trace versus hyperproperty exploits: Some violations have an individual forbidden execution as a witness; others, such as information leaks through timing, require comparing sets of executions.
- Conditional composition: Exploits do not automatically persist through a compiler stack. The paper proves propagation results under correctness or trace-preservation assumptions and conditions on behavior relations.
- Mitigations need semantic checks: In the toy natural-number example, rejecting negative inputs by silently producing no output still introduces behavior unavailable at the source; returning a permitted value instead eliminates that particular weird machine.
Connections
- Exploit Programming - From Buffer Overflows To Weird Machines — gives the exploitation-as-programming perspective that this paper formalizes through secure compilation.
- Weird Machine — an explicit behavioral definition, relative to a source abstraction and an attacker model.
- Compiler Correctness — distinguishes correctness for complete programs from preserving security against target-level contexts.
- Return-Oriented Programming — illustrates breaking source control-flow abstractions through target-level manipulation of return addresses.
- LangSec — complementary accounts of representation boundaries: language recognition constrains accepted inputs; this framework asks whether their implementation preserves source-level abstractions.
- CBCL - Safe Self-Extending Agent Communication — a possible application of the framework is to compare source-level communication guarantees with expanded or executed behavior. This is a wiki connection, not an application established by the paper.
Conceptual Contribution
- Claim: Exploits can be characterized as witnesses to insecure compilation, and weird machines as the resulting behaviors that cannot be simulated at the source level.
- Mechanism: Defines components, linking contexts, attacker classes, compilation, and a relation between source and target behaviors; connects the absence of a source-context simulation to failures of robust property preservation and studies propagation through compiler stacks.
- Concepts introduced/used: Weird Machine, Compiler Correctness, Return-Oriented Programming, Formal Verification.
- Stance: formalization
- Relates to: Refines Exploit Programming - From Buffer Overflows To Weird Machines with a semantic criterion for unintended computation; complements LangSec by examining whether implementation preserves the abstractions that input and execution models promise.