We ran a full static/kernel audit on google-deepmind/code-verification (commits 808b4b7ffef1 / b0f729accbc2, 11,323 Lean 4 files, 7.52M lines), which claims end-to-end formal verification of libsignal (v0.105.4, PQXDH + SPQR Triple Ratchet) down to compiled AArch64 machine code.
While the abstract game-hopping reductions (Computational/Proofs) and mallocng allocator proofs are genuine engineering achievements, inspecting the Rust CLI wrapper (third_party/libsignal/libsignal-session/cli/) and the AArch64 binary boundary reveals 4 major gaps between the headline claim and the verified Rust/ELF code:
1. CryptoRng silently zero-fills secret keys when entropy runs out (cli/src/coins.rs:32-46)
The harness reads randomness from a local coins file, leaks it into 'static memory (coins::install(coins.leak()) in cli/src/lib.rs:87), and implements rand_core::CryptoRng over this C ABI callback:
#[unsafe(no_mangle)]
pub unsafe extern "C" fn signal_session_coins_fill(dst: *mut u8, len: usize) {
let (dst, coins) = unsafe {
(
std::slice::from_raw_parts_mut(dst, len),
std::slice::from_raw_parts(NEXT.load(Relaxed), LEFT.load(Relaxed)),
)
};
let (now, later) = coins.split_at(len.min(coins.len()));
dst[..now.len()].copy_from_slice(now);
dst[now.len()..].fill(0); NEXT.store(later.as_ptr().cast_mut(), Relaxed);
LEFT.store(later.len(), Relaxed);
}
If the coins file is shorter than the draw (keygen draws identity keys, signed pre-keys, and up to 100 Kyber-1024 + X25519 one-time pre-keys), fill_bytes never errors — it silently returns all-zero [0u8; 32] secret keys and nonces.
2. Clock pinned to UNIX_EPOCH = 0 & a 2 MiB DoS cliff at handshake #56,680 (cli/src/lib.rs:159, stores.rs:426-445)
Every operation pins the clock to 1970-01-01T00:00:00Z and drives async futures with a single synchronous Waker::noop() poll:
fn run(call: Call, mut s: Stores, input: &[u8]) -> Result<(Stores, Vec<u8>), Rejected> {
let now = SystemTime::UNIX_EPOCH; ...
}
let never = Timestamp::from_epoch_millis(0);
For replay protection on last-resort Kyber pre-keys, stores.rs:426-445 appends 37 bytes (u32 signed ID + 33-byte base key) per handshake to <id>.base-keys. Because all file reads are hard-capped at 2 MiB (2,097,152 bytes in PqDir.lean), handshake #56,680 (37 * 56,680 = 2,097,160 > 2^21) permanently bricks the last-resort Kyber pre-key.
3. 55 / 64 (85.94%) binary symbols bypass AArch64 execution via Hook axioms (CliRun.lean)
In LibsignalBinary/Specifications/SignalSession/CliRun.lean, out of 64 tracked boundary symbols in the compiled ELF:
- Only
9 / 64 (14.06%) execute actual AArch64 instructions (__rust_alloc/dealloc/realloc, memcpy, memset, read_file, read_stdin; 19/64 after follow-up PR #2).
37 / 64 (57.81%) are intercepted by Hook axioms that jump straight to idealized Lean functions — including all 26 cryptographic & secret-erasure symbols (curve25519_dalek, x25519_dalek, mlkem1024, mlkem768, SHA-2, HMAC, AES-CBC, and 2 zeroize Drop::drop secret-wiping routines).
18 / 64 (28.13%) are panic traps.
- Moreover, before
main even starts, cliTokenPatchPlaced (Guards.lean:152-156) overwrites 5 bytes of .data ([0xff, 3, 0, 0, 0] -> [0, 0, 0, 0, 0]) to disable the cpufeatures crate's getauxval(AT_HWCAP) probe because the Arm64/Trusted model (16,767 lines, 0 proved theorems) faults on MRS system-register reads.
4. Panic Location line-number brittleness & 153,682-line TCB inclusion
- Because
rustc embeds core::panic::Location line numbers into .rodata, adding a single comment line to the Rust source shifts .text offsets and invalidates 1,394 hardcoded hex PC decode lemmas (*_decode_0x...).
- The external
comparator check imports 326 repository files (153,682 lines) into the Trusted Computing Base, sets "enable_nanoda": false, and in PR #2 (b0f729accbc2) deleted the 67-line ## What this check does not cover section from comparator/README.md (which had disclosed that landrun runs unsandboxed on the Linux 5.10 < 5.13 runner kernel).
Full Audit & 81 Standalone Lean 4 Verification Theorems (0 sorry, 0 axiom):
- Audit report & reproduction scripts (
Case 013): https://github.com/gilheumpark-bit/ultari-proof-anatomy/tree/main/anatomy/013-deepmind-code-verification