[Paper Review] Misquoted No More: Securely Extracting F* Programs with IO
This paper presents SEIO⋆, a formally verified extraction framework that securely extracts IO-enabled F⋆ programs to a deep embedding while providing robust security guarantees (RrHP) against arbitrary unverified contexts, using relational quotation to minimize translation validation.
Shallow embeddings that use monads to represent effects are popular in proof-oriented languages because they are convenient for formal verification. Once shallowly embedded programs are verified, they are often extracted to mainstream languages like OCaml or C and linked into larger codebases. The extraction process is not fully verified because it often involves quotation -- turning the shallowly embedded program into a deeply embedded one -- and verifying quotation remains a major open challenge. Instead, some prior work obtains formal correctness guarantees using translation validation to certify individual extraction results. We build on this idea, but limit the use of translation validation to a first extraction step that we call relational quotation and that uses a metaprogram to construct a typing derivation for the given shallowly embedded program. This metaprogram is simple, since the typing derivation follows the structure of the original program. Once we validate, syntactically, that the typing derivation is valid for the original program, we pass it to a verified syntax-generation function that produces code guaranteed to be semantically related to the original program. We apply this general idea to build SEIO*, a framework for extracting shallowly embedded F* programs with IO to a deeply embedded lambda-calculus while providing formal secure compilation guarantees. Using two cross-language logical relations, we devise a machine-checked proof in F* that SEIO* guarantees Robust Relational Hyperproperty Preservation (RrHP), a very strong secure compilation criterion that implies full abstraction as well as preservation of trace properties and hyperproperties against arbitrary adversarial contexts. This goes beyond the state of the art in verified and certifying extraction, which so far has focused on correctness rather than security.
Motivation & Objective
- Provide formal security guarantees for extracted F⋆ IO programs even when linked with unverified code.
- Minimize reliance on translation validation during extraction by using relational quotation.
- Develop a verified extraction pathway from IO⋆ to a deep embedding λio with IO primitives.
- Prove that SEIO⋆ satisfies Robust Relational Hyperproperty Preservation (RrHP), implying full abstraction and trace/hyperproperty preservation.
- Demonstrate practical realizability with a machine-checked artifact in F⋆.
Proposed method
- Introduce relational quotation to generate a typing derivation for a shallowly embedded IO⋆ program within F⋆.
- Define IO⋆ and λio with trace-producing semantics and two cross-language logical relations.
- Provide a pure F⋆ function that, given a typing derivation, constructs the corresponding λio program.
- Use metaprogramming (Meta-F⋆) to produce and verify the typing derivation from a shallow IO⋆ program.
- Prove, via machine-checked proofs in F⋆, that SEIO⋆ satisfies Robust Relational Hyperproperty Preservation (RrHP).
Experimental results
Research questions
- RQ1How can we extract IO⋆ programs to a deeply embedded λio while ensuring security properties against arbitrary contexts?
- RQ2Can relational quotation reduce reliance on translation validation in certified extraction frameworks?
- RQ3What formal guarantees (like RrHP) can be achieved for extracted IO code and how do they relate to full abstraction?
- RQ4How can a machine-checked, F⋆-based artifact certify the extraction process and its security properties?
Key findings
- SEIO⋆ enables extraction of IO⋆ programs to λio with formal secure compilation guarantees.
- Relational quotation creates a typing derivation that ties the shallow IO⋆ program to its deep embedding without full translation validation.
- Two cross-language logical relations relate IO⋆ and λio and support machine-checked proofs of security properties.
- The framework achieves Robust Relational Hyperproperty Preservation (RrHP), implying full abstraction and preservation of trace properties and hyperproperties against adversarial contexts.
- An artifact in F⋆ provides machine-checked proofs of RrHP for SEIO⋆ with extensive definitions and proofs.
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.