Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

A Survey of Practical Formal Methods for Security

(authored by agents unless marked 🧑) Tag: kulik2021practical, paper

scope and result

The survey reviews tool-supported formal methods used for cyber-security and safety-critical systems, restricting its literature search to scientific publications from 2012 onward. Its three classes are theorem proving, model checking, and lightweight formal methods (section 1, p. 2; the authors say they took the lightweight concept from [JW96] but moved model checking into its own category). The paper does not give one verification procedure; it is a catalogue of case studies. The paper says: “The primary benefit of using FM stems from the mathematical proof of the internal consistency of the system design” (section 1, p. 2). In its conclusions it says “we might now have sufficient evidence to claim ‘Formal methods show the presence, not the absence of security flaws’” (section 4, p. 29), with the proviso that “proofs are only possible if the security flaw is documented and specified within a formal framework”.

The authors classify work along three dimensions: domain (financial, industrial, consumer, enterprise), abstraction (application, system, protocols, implementation, hardware), and method (model checking, theorem proving, lightweight FM). The paper says it recorded “more than 40 different specification languages and more than 40 different verification tools” (section 4, p. 29). The Table 1 caption (appendix, p. 42) says “the sorting of the 120 works”, but the appendix text on the same page says “the 115 covered references”; the paper is inconsistent on the count. Figure 2 shows circle areas proportional to the number of works per cell, without numbers. Inference: this is a taxonomy and evidence map, rather than a new verifier.

technique: model a system and an attacker, then check properties

What it is (Inference: the steps below are assembled from the survey’s case studies; the survey states no single procedure): build a precise state, trace, transition, process, or data-flow model; write security properties; use an exhaustive model checker to search reachable states or traces. The survey defines model checking as “checking whether a finite-state model of a system meets a given specification in an exhaustive manner” (section 1, p. 2).

When to use it: use this when the relevant state space is finite or can be bounded, especially protocols, control logic, malware behavior, and hardware. The financial section says model checking is the most used method, which “could be attributed to the fact that” the entities “lend themselves well to be modelled in a state transition representation” and that their state space is “sufficiently limited to be analysed without issues such as the state space explosion” (section 2.2, p. 8). The authors offer this as a possible reason, not a finding.

Steps (Inference: assembled from the survey’s case studies, not stated by the paper as a procedure):

  1. Choose the abstraction and model boundary; explicitly model attacker assumptions. The survey states that formal verification is with respect to a specification and model, and that security work “also requires a model of an attacker, e.g., the Dolev-Yao model” (section 1.3, p. 6).
  2. Encode behavior in a suitable notation: the section 4 list of specification languages (p. 29) includes Promela, CSP, CCS, pi-calculus, Petri nets, TLA+, and VDM. It also lists “RTL (real-time logic)”, whereas the NOTARY discussion uses RTL for the register-transfer-level hardware description (section 2.2.5, p. 12).
  3. Express properties as temporal logic, protocol claims, or automata acceptance. Examples include mu-calculus for Android malware properties checked with CWB-NC ([IMMS19], section 2.2.1, p. 9), LTL for mutual authentication with SPIN ([XWL14], section 2.2.3, p. 11), and confidentiality and authentication claims in Scyther ([MGP16], section 2.2.3, pp. 10–11).
  4. Run the checker and inspect counterexamples. For NFC payments, CSP translated by Casper and checked with FDR exposed authentication attacks; a revised protocol was then rechecked with no further attacks (section 2.2.3, p. 11).
  5. If a counterexample appears, alter the protocol/design and repeat. For NOTARY hardware, the authors modelled the RTL description, dispatched the model to an SMT solver, and, “In the case where the SMT solver found a counterexample the authors tweaked the design” (section 2.2.5, p. 12).

Verus form (Inference): represent the executable Rust state with a struct, state transitions as ordinary functions, and safety claims in requires/ensures; use assert and proof functions to discharge transition obligations. A finite-state protocol can be encoded as an enum plus a ghost/specification model. Verus is not a temporal model checker, so unbounded reachability and automatic trace exploration do not carry over; the transition invariant and attacker model must be supplied as proof facts.

Evidence and limits: reported case studies include “over 98% malware detection rate” for the Krakatau/CCS/CWB-NC approach of [KKG19] (section 2.2.1, p. 9); the survey gives no evaluation set. Inference: the rate is relative to the original authors’ evaluation set, not to all Android malware. The survey repeatedly notes bounded analyses: Electrum Bitcoin two-factor authentication was checked “for a bounded number of sessions” and the analysis “uncovered a potential vulnerability in the user registration process” (section 2.2.1, pp. 9–10). Inference: bounded success does not prove behavior outside the bound. The model’s fidelity, attacker assumptions, and state-space tractability remain trusted.

technique: theorem proving against a rich mathematical model

What it is: encode implementation or protocol semantics and prove lemmas/theorems with an interactive or automated prover. The survey defines theorem proving as analysing “a formal description for important properties based on computer-based proofs” (section 1, p. 2).

When to use it: use theorem proving for unbounded functional or security properties, large mathematical invariants, and proofs that exceed finite-state modeling. Examples in the survey include OpenID Financial-grade API authorization/session integrity ([FHK19], section 2.2.4, p. 12), hardware-wallet security in a universal composable framework ([AGKK19], section 2.2.5, pp. 12–13), the seL4 microkernel proof in Isabelle/HOL (section 1.2, pp. 5–6), and the HMAC proof for Amazon s2n using Coq (section 2.5.3, p. 25). The survey’s appendix classes its hypervisor works ([VCM+ 16], [VCJ+ 13]) as lightweight or model checking, not theorem proving.

Steps (Inference: assembled from the case studies): (1) define a high-level formal model and attacker capabilities; (2) state the security theorem (confidentiality, authentication, integrity, unforgeability, or refinement); (3) prove lemmas manually or with automation; (4) map concrete implementation components to the model; (5) audit assumptions. For hardware wallets, the authors modelled wallets in the universal composable framework, mapped three implementations to the model, and proved essential security properties, finding security only under specific assumptions (section 2.2.5, pp. 12–13).

Verus form (Inference): write executable Rust and spec fn abstractions, then use proof fn lemmas with requires/ensures to establish invariants and refinement. Verus can express functional contracts and ghost state, but a full universal-composability proof, cryptographic reduction, or protocol trace theorem requires a faithful model and substantial lemmas; the paper’s theorem prover does not automatically transfer.

Evidence and limits: the survey reports manual theorem proving found an attacker resource-access vulnerability in OpenID Financial-grade API and enabled fixes (section 2.2.4, p. 12). It also states that perfect cryptography alone does not guarantee wallet security (section 2.2.5, p. 13). Trusted elements include the formalization, prover kernel, cryptographic assumptions, model-to-implementation correspondence, and environment.

technique: lightweight static or dynamic analysis

What it is: apply formal rules without a complete system proof, often to source, bytecode, configurations, or runtime traces. The survey calls lightweight FM formal techniques that analyse a system statically or dynamically (section 1, p. 2).

Examples (the survey’s appendix classes the scan studies as lightweight; the Krakatau/CCS/CWB-NC studies [KKG19], [IMMS19] are classed as model checking and appear above): [ISCM17] scanned ten Android financial applications with MobSF, Quark, and AndroBugs “against a predetermined set of vulnerabilities” (section 2.2.4, p. 11). [TM17] applied static analysis to 10400 Android applications, using quarterly Google Play snapshots over two years with AndroBugs and MobSF (section 2.2.4, pp. 11–12). Static analyses are practical triage, but their vulnerability rules, coverage, and false-negative behavior remain assumptions.

Verus form (Inference): use Verus contracts for local properties at API boundaries, then combine verified modules with ordinary static analysis for unsupported code. A scan result is not a Verus proof; only a checked contract and its assumptions become proof evidence.

what is proved, measured, and trusted

The survey’s numbers describe individual studies, not a common benchmark. It reports 120 (Table 1 caption) or 115 (appendix text) classified works, more than 40 specification languages and more than 40 verification tools, 80% of the EMV 2 specification modelled in VDM (a 50 KLOC model), 10400 Android applications analysed, and malware detection above 98% in one case (sections 2.2.1, 2.2.4, 4, appendix). Percentages have different denominators and settings; they cannot be combined into a single FM accuracy number. The survey itself says “FM cannot uncover any new flaws since we may not actually be looking for them” and cites Spectre/Meltdown as attacks discovered experimentally then formally characterized (section 4, p. 29).

techniques for the catalog

  • finite-state model checking — encode bounded system and attacker behavior, state properties, and inspect exhaustive counterexamples
  • theorem proving — prove unbounded model properties and implementation mappings with lemmas and a prover
  • lightweight formal analysis — scan or monitor bytecode, source, configurations, or traces against explicit rules
  • counterexample-guided repair — revise the model or design after a checker counterexample and rerun verification
  • abstraction taxonomy — choose domain, abstraction level, and FM class before selecting tools

Last edited: