Security.lean
Cited in the paper
/-
Copyright 2026 Google LLC
All code is licensed under the Apache License, Version 2.0 (the "Apache 2.0"); you may not use this file except in compliance with the Apache 2.0 license. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and
limitations under the License.
-/
module
public import LibsignalBinary.Specifications.SignalSession.CliElf
public import LibsignalBinary.Specifications.SignalSession.CliLabels
public import Symbolic.Specifications.Security.Binary
import Symbolic.Proofs.TopLevelHelpers.Composed.Cli.AsmLevelSecurityElf
Symbolic Security of the libsignal-cli Binary
Trusted: the statement.
Main symbolic security theorem for the SHA-256-pinned AArch64 libsignal-cli binary (cliElfBytes, LibsignalBinary/), covering PQXDH session setup with SPQR V1 composed with the Triple Ratchet. Built by lake build CliElfLib; see Symbolic/ for the proof architecture.
signal_ combines:
-
Symbolic/: the ten protocol security properties in the composed symbolic model;Theorems/ ModelSecurity.lean -
Symbolic/(Theorems/ Refinement.lean comp_refines_cli_placed): relocatable trace refinement and progress ofcliElfBytesup to cryptographic collisions; -
Symbolic/(Theorems/ RefinementPreservation.lean comp_): transfer of the ten security properties across trace refinement.refinement_ preservation_ cli
Non-vacuity of the extern and hook hypotheses is proved by comp_externsSatisfiable_cli (Symbolic/), and placement non-vacuity by libsignal_cli_elf_linked_in and libsignal_.
Trusted computing base. Lean's kernel checks code bytes, relocations, addresses, and segment layout directly against cliElfBytes (Placed. / InElf, cliElf_linkedAt_unique). Symbol-name labels rest on the trusted .o extractor (libsignal_, assumption A-LINK in Computational/).
@[expose] public sectionset_option autoImplicit falsenamespace Proven.Securityopen CryptoVerification.SignalSession (cliElfBytes libsignalSessionLib CliLabelsFromObjects)open DY.Libsignal.Composed.Security (SignalSessionSecurePlaced)
theorem signal_
Relocatable symbolic security and progress for the SHA-256-pinned libsignal-cli AArch64 binary (SignalSessionSecurePlaced cliElfBytes, Symbolic/). For every pair of multi-block placements mpl (libsignalSessionLib.cliElfBytes mpl) and mmpl (VerifiedLibraries.cliElfBytes mmpl), cliElfBytes parses as an AArch64 ELF image satisfying CliElfCodeMatchesPlaced mpl mmpl, every reachable guarded CLI call terminates with a process outcome (CliElfProgressPlaced mpl mmpl), and under any valid cryptographic extern interpretation and matching CLI hooks, every guarded, coin-fresh execution trace of cliRunPlacedSig mpl mmpl from initDirs is either explained by a reachable model run with all ten protocol security queries holding against HwAttackerKnows, or encounters a cryptographic collision after an explained prefix on which all ten queries hold over that prefix's vis (SignalSessionSecureFor, Symbolic/).
theorem signal_session_secure_placed :
SignalSessionSecurePlaced cliElfBytes := ⋯theorem libsignal_cli_elf_linked_in
Session placement witness: cliElfBytes links libsignalSessionLib at a concrete multi-block placement (libsignalSessionLib.cliElfBytes).
theorem libsignal_cli_elf_linked_in : libsignalSessionLib.LinkedIn cliElfBytes := ⋯
theorem libsignal_
Allocator placement witness: cliElfBytes links the musl mallocng allocator library VerifiedLibraries. at a concrete multi-block placement (VerifiedLibraries.cliElfBytes), discharging both LinkedAt hypotheses (mpl and mmpl) together with libsignal_cli_elf_linked_in.
theorem libsignal_cli_elf_mallocng_linked_in :
VerifiedLibraries.mallocngLib.LinkedIn cliElfBytes := ⋯
theorem libsignal_
Label gate A (CliLabelsFromObjects, LibsignalBinary/): the symbol names interpreted by SignalSessionSecurePlaced cliElfBytes and CompRefinesCliBinaryPlaced cliElfBytes (hooked externs, SIGABRT panic externs, and SPQR CPU-probe statics) match the symbol names extracted from the pre-link .o objects.
theorem libsignal_cli_labels_from_objects : CliLabelsFromObjects := ⋯end Proven.Security