Skip to content

WHIR verifier protocol audit + VM/arena memory safety#219

Open
XC0R wants to merge 2 commits into
leanEthereum:mainfrom
XC0R:whir-verifier-audit-and-safety-hardening
Open

WHIR verifier protocol audit + VM/arena memory safety#219
XC0R wants to merge 2 commits into
leanEthereum:mainfrom
XC0R:whir-verifier-audit-and-safety-hardening

Conversation

@XC0R
Copy link
Copy Markdown

@XC0R XC0R commented May 11, 2026

Summary

Verifier audit coverage

Test Paper reference
completeness_simple_evaluation_constraint Construction 5.1 completeness
completeness_multiple_evaluation_constraints §5.2 Construction 5.5 (batching)
soundness_wrong_evaluation_rejected Theorem 5.2 (soundness)
error_budget_johnson_bound_parameters Theorem 5.2 error bounds
expand_from_univariate_matches_pow_definition §3 pow(x, m) notation
folding_definition_consistency §4.3 Definition 4.14
univariate_horner_matches_multilinear_on_evals_to_coeffs_output evals_to_coeffs bit-reversal convention
folded_domain_generator_order Construction 5.1 step 2d
combination_weights_start_from_one Convention vs Construction 5.1 step 2e
sumcheck_degree_correct_for_eq_weight Construction 5.1 degree d = max{d*, 3}
security_assumptions_distance_parameters §6.2 (UD/JB/CB δ)
ood_error_formula_matches_lemma_4_25 Lemma 4.25 (OOD error)

The proximity gap computation (JohnsonBound) was also verified term-by-term against BCSS25 Theorem 1.5 (eprint 2025/2055, equation 1).

Address overflow scope

checked_add applied at every site where bytecode/hint-derived offsets compute memory addresses:

  • MemOrConstant::read_value, memory_address
  • MemOrFpOrConstant::read_value (MemoryAfterFp + FpRelative), memory_address
  • Instruction::Deref — both fp + shift_0 and ptr + shift_1
  • Hint::RequestMemory, Inverse, DerefHint, HintWitness (Inline + Indirect)

Closes #170, closes #176.

XC0R added 2 commits May 11, 2026 00:35
WHIR verifier audit (crates/whir/tests/verifier_protocol_audit.rs):
12 tests pinned to ACFY24 (eprint 2024/1586) Construction 5.1 and
Theorem 5.2. Validates end-to-end completeness, soundness rejection,
error budget parameters, folding consistency (Def 4.14), domain
generator primitivity, OOD error formula (Lemma 4.25), security
assumption distance parameters (§6.2), sumcheck degree correctness,
and the evals_to_coeffs bit-reversal coefficient convention.

Arena safety (leanEthereum#170, crates/backend/air/src/symbolic.rs):
Bounds-check get_node before unsafe read_unaligned. Assert alloc_node
index fits u32 before truncation. 5 tests.

Address overflow (leanEthereum#176, crates/lean_vm):
checked_add in MemOrConstant, MemOrFpOrConstant, Deref instruction,
and 6 hint execution sites. New AddressOverflow error variant. 10 tests.

Closes leanEthereum#170, closes leanEthereum#176.
CI clippy with -Dwarnings catches unused imports in test targets
that local clippy --workspace does not.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[M-4] Unchecked fp+offset overflow enables wrong memory access [H-3] Unchecked arena index enables out-of-bounds reads

1 participant