TL;DR
ZEBRA is a fully automated verification and bug-detection framework for zero-knowledge virtual machines (zkVMs) that treats constraint correctness as a solution-set cardinality problem. By lifting finite-field constraints to an integer interval lattice and executing a parallel branch-and-bound search, ZEBRA bypasses the scalability bottlenecks of traditional SMT solvers. It successfully uncovered 11 zero-day vulnerabilities in production zkVMs while running over 50x faster than standard SMT-based methods.
What Problem Does This Paper Address?
Zero-Knowledge Virtual Machines (zkVMs) are rapidly becoming the backbone of verifiable computing in blockchain, machine learning, and secure supply chains. They allow a user to execute a standard program (written in languages like Rust or C++) and generate a cryptographic proof that the execution was correct.
To achieve this, a zkVM translates the virtual machine's operational logic (CPU state transitions, memory reads/writes, ALU operations) into a massive system of polynomial equations called algebraic constraints.
Writing these constraints is incredibly difficult and error-prone. If a constraint is missing or too weak, the system is under-constrained, allowing a malicious prover to forge proofs for invalid executions. If a constraint is too restrictive, the system is over-constrained, rejecting valid program runs.
Existing tools fail to secure these systems at scale:
- Fuzzers and unit tests sample concrete inputs but easily miss subtle edge cases hidden in massive finite fields.
- SMT solvers struggle to scale due to the sheer size and non-linearity of the constraints.
- Interactive theorem provers (like Lean) offer ironclad guarantees but demand months of manual, expert engineering.
Methods
The authors introduce ZEBRA, which reframes zkVM verification around a simple, elegant correctness criterion: for any given program and input, the constraint system must admit exactly one unique, valid execution trace.
ZEBRA automates this check using three core techniques:
- Canonicalized Table Space: Raw execution traces often contain representational redundancies, such as empty padding rows or row permutations. ZEBRA introduces a lightweight canonicalization layer to filter out these artifacts, ensuring that counting the solutions actually reflects distinct semantic executions. The injectivity of this layer was formally verified using the Lean 4 theorem prover.
- Sound Interval Propagation: Rather than evaluating constraints using exact finite-field values, ZEBRA lifts the analysis to an integer interval lattice. It implements conservative propagation rules that safely handle modular arithmetic wrap-around, providing a sound over-approximation of all feasible executions.
- Parallel Branch-and-Bound Search: ZEBRA systematically partitions the trace space into independent subproblems. If interval propagation proves a region cannot satisfy the constraints, it is aggressively pruned. If a region collapses to a single valid trace, it is certified. If multiple distinct traces satisfy the constraints, ZEBRA flags an under-constrained bug and outputs a concrete counterexample.
To accelerate convergence, ZEBRA incorporates Backward Interval Refinement (running constraints in reverse to shrink bounds) and Certified Circuit Elision (simplifying complex range-check sub-circuits).
Datasets
As a software verification paper, ZEBRA does not use traditional machine learning datasets. Instead, it targets a benchmark suite composed of five real-world, production-grade zkVM backends:
- Pico, SP1, and Sphinx (which target the RISC-V architecture)
- Ziren (which targets MIPS)
- Valida (which targets a custom LLVM-friendly ISA)
The evaluation focused on core instruction tables (ALU, control-flow, memory operations) and non-instruction tables (global state and execution flow).
Key Insights and Ideas
- Exploiting Structural Sparsity: The authors discovered that real-world zkVM constraint systems are remarkably sparse. On average, constraints utilize only 14.0% of their theoretical connectivity capacity. ZEBRA exploits this property because sparse constraints mean interval updates propagate locally, minimizing the over-approximation error that usually plagues interval arithmetic.
- Searching the Table Domain Directly: Traditional mutation-based fuzzers operate by modifying the VM executor. However, a malicious prover isn't bound by the executor; they can write arbitrary values directly into the trace tables. By searching the table domain directly, ZEBRA catches critical bugs in auxiliary columns (like selector flags) that executor-level fuzzers are structurally blind to.
- Amortized Range Verification: Instead of verifying a circuit point-by-point, ZEBRA feeds broad interval ranges into the inputs. Because the branch-and-bound algorithm maintains a total cover of the search space, it can collapse massive contiguous input regions into single, sound judgments, leading to sublinear scaling.
Key Results
- Vulnerability Discovery: ZEBRA discovered 11 previously unknown zero-day vulnerabilities across the five production zkVMs. These included critical flaws allowing control-flow hijacking and proof forgery. At the time of writing, 6 had been independently confirmed by developers and 3 were already fixed. A state-of-the-art zkVM fuzzer (Arguzz) failed to find any of them.
- Performance vs. SMT: Compared to the industry-standard Z3 SMT solver, ZEBRA was 51.5× faster on average and successfully verified 16.5 percentage points more instruction targets (achieving a 48.0% success rate vs. Z3's 31.5%).
- Range Verification Efficiency: ZEBRA’s unified interval-lattice reasoning achieved up to a 63× speedup over iterative point-wise verification baselines.
Limitations and Future Work
- Table-Localized Verification: ZEBRA currently operates in a localized mode, isolating individual tables and assuming peripheral tables are correct. It cannot yet catch global bugs caused by cross-table interface mismatches. The authors note that a fixed-point iteration strategy could formally compose these local certificates into global proofs in the future.
- Incompleteness from Interval Loss: Interval abstraction can sometimes merge feasible and infeasible assignments, returning an
Uncertainstatus. While this never causes false positives (spurious bug reports), it can stall verification or demand excessive splitting under tight time budgets. - High-Dimensional Non-Instruction Tables: While ZEBRA successfully tested non-instruction tables using a "warm-starting" heuristic, their high dimensionality (60–100 columns) makes full, exhaustive interval-based verification computationally impractical without further optimizations like opcode-based slicing.
Summary updated