arXiv:2608.30648cs.CRAug 2026

Manuscript Offprint

arXiv:2608.30648

Lie to Me: Finding Bugs in ZK DSL Toolchains with Adversarial Witness Injection

Sebastian Watzinger, Christoph Hochrainer, Valentin Wüstholz, Maria Christakis

Abstract

Zero-knowledge domain-specific language (ZK DSL) toolchains compile programs into constraint systems and generate witnesses for cryptographic proofs. Bugs in these toolchains can leave the enforced constraints weaker than the source-program semantics, admitting proofs for invalid executions. Such soundness bugs may remain invisible to valid-execution testing because all valid executions still behave correctly.

We present LIEZZ, a testing framework that generates ZK DSL programs and exposes these bugs through adversarial witness injection. For each generated deterministic program, LIEZZ executes two public input assignments with different outputs and splices their witnesses, combining the input of one execution with the output of the other. The resulting witness is invalid by construction. A correct toolchain must reject it; acceptance exposes a soundness bug. Controlled divergence and multiple witness-splicing strategies preserve enough consistency to expose missing constraints. LIEZZ also generates parameterized standard-library calls to reach complex functionality.

LIEZZ supports CIRCOM, CORSET, GNARK, and NOIR. It finds 13 bugs, including seven with soundness impact. Several are reachable only through generated standard-library calls. Under the same testing budget, a valid-execution baseline does not expose any of the soundness failures revealed by accepted injected witnesses, showing that adversarial witness injection reaches failures missed by valid-execution testing.

1 Introduction

Zero-knowledge domain-specific languages (ZK DSLs) let developers build verifiable applications without writing low-level constraints. Their toolchains compile programs into constraint systems, generate witnesses, and produce verifier-checked proofs. These systems combine compilers, standard libraries, witness generators, and prover backends. Bugs can cause soundness issues, where invalid executions are accepted, or completeness issues, where valid ones are rejected.

Soundness bugs are especially severe. If generated constraints do not enforce the source-program semantics, a malicious prover can prove a nonexistent computation. In applications that use proofs for authorization, this can enable unauthorized withdrawals or asset minting, or bypass identity and policy checks. Completeness bugs can instead deny service by preventing valid transactions or time-sensitive proofs.

Existing ZK DSL testing techniques derive their oracles from valid, semantics-preserving executions. CIRCUZZ [14] and MTZK [31] use metamorphic relations [10], which should preserve observable behavior. Such oracles can expose bugs affecting valid executions, but do not directly test whether a toolchain rejects invalid witnesses. Purely underconstrained computations may therefore remain invisible: all valid executions behave correctly, although additional invalid witnesses are accepted. Recent work finds that existing security tools for zero-knowledge systems provide limited support for detecting such semantic mismatches, in which constraints accept witnesses that do not correspond to valid executions even when the computation is deterministic [19]. Chaliasos et al. [7] identify generating invalid witnesses without violating unrelated constraints as an open challenge for fuzzing ZK circuits. We address this challenge for ZK DSL toolchains.

Our approach. We present LIEZZ, a testing framework that generates ZK DSL programs and tests toolchains with a new oracle: adversarial witness injection. For each deterministic program, LIEZZ executes it on two public input assignments with different outputs. It combines one execution's input with the other's output and splices intermediate values from both witnesses. The resulting witness is invalid by construction, so a correct toolchain must reject it. Acceptance exposes a soundness bug in enforcing the source-program semantics.

To reach realistic functionality, LIEZZ generates parameterized calls to standard-library routines. These routines often expand to many constraints and intermediate witness values, where several bugs found by LIEZZ occur.

Challenges. Randomly mutating a witness is insufficient. A mutation often violates unrelated constraints, causing rejection even when part of the computation is underconstrained.

Figure

Figure 1: Architecture of a ZK DSL toolchain. A program is compiled into constraints and executed on inputs to produce a witness. The prover uses both to produce a proof, which the verifier checks against the public inputs and constraints.

Moreover, the mutated witness is not necessarily invalid because a constraint system may admit multiple witnesses for the same source-level input-output behavior. For example, changing an unused input produces a different but still valid witness. LIEZZ instead constructs invalid witnesses from valid executions with different outputs and creates controlled divergence between them. This preserves the expected witness structure while introducing an input-output contradiction.

Complex operations may require different combinations of intermediate values. LIEZZ therefore uses multiple witness-splicing strategies to expose both simple missing constraints and bugs requiring coordinated changes to related values.

Results. LIEZZ supports four ZK DSL toolchains: CIR-COM [6], CORSET [1], GNARK [3], and NOIR [4]. It finds 13 bugs across all toolchains, including seven with soundness impact. Several are reachable only through generated standard-library calls. The NOIR soundness bug 9 in Table 1 earned a $70,000 bug bounty. Under the same budget, CIR-CUZZ's valid-execution oracle does not expose the soundness failures revealed by accepted injected witnesses, while remaining effective for completeness bugs. These results show that adversarial witness injection targets a failure mode that remains invisible when testing only valid executions.

Contributions. We make the following contributions:

• We introduce adversarial witness injection, which constructs invalid witnesses from two valid executions using controlled divergence and multiple witness-splicing strategies.

• We realize this oracle in LIEZZ, supporting typed, parameterized standard-library calls and rich language constructs across four ZK DSL toolchains.

• We evaluate LIEZZ on four toolchains, showing that accepted injected witnesses expose soundness failures not observed by a valid-execution oracle under the same budget.

References (27)