Manuscript Offprint
arXiv:2608.30648Lie to Me: Finding Bugs in ZK DSL Toolchains with Adversarial Witness Injection
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 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.
2.1 ZK DSL Toolchains
Figure 1 shows the architecture of a ZK DSL toolchain. A program P is compiled into a constraint system C. Executing P on inputs I produces a witness W containing values that satisfy C. The prover uses C and W to produce a proof , which the verifier checks against the public inputs and C.
2.2 Witnesses and Program Semantics
For adversarial-witness testing, LIEZZ generates programs with public inputs and outputs. We write when executing P on inputs I produces outputs O. Abstractly, a witness contains inputs, intermediate values X, and outputs:
Witness layouts differ across toolchains, and some use execution traces rather than flat arrays. LIEZZ only needs to identify the inputs, outputs, and intermediate values that it can modify.
LIEZZ relies on determinism: fixed inputs determine outputs. If and with , a witness combining with cannot represent a valid execution of .
2.3 Soundness and Completeness Bugs
A completeness bug rejects a valid execution, for example through a crash or rejection of a proof generated from a valid witness. A soundness bug accepts an invalid execution, allowing a prover to produce a proof that verifies even though the computation violates the source-program semantics.
Adversarial witness injection targets soundness bugs by constructing witnesses that a correct toolchain must reject. It can also expose completeness bugs if the toolchain crashes while processing a generated program or injected witness.
1 use std::embedded_curve_ops::{ 2 EmbeddedCurveScalar, fixed_base_scalar_mul}; 3 4 pub fn main(i : pub(Field)) -> pub(Field) { 5 let p = fixed_base_scalar_mul( 6 EmbeddedCurveScalar::from_field(i) 7 ); 8 let o = if (p.is_infinite) { 123 } else { 42 }; 9 (o) 10 }
1 inputs : i 2 outputs: o 3 4 o = fixed_base_scalar_mul_is_infinite(i) 5 ? 123 6 : 42
(a) CIRCIL
(b) NOIR
Figure 2: Simplified version of a generated CIRCIL program for a NOIR soundness bug found by LIEZZ and its NOIR translation. The program performs fixed-base scalar multiplication and branches on the resulting is_infinite flag.
2.4 CIRCUZZ and CIRCIL
LIEZZ builds on the program-generation and translation infrastructure of CIRCUZZ, a metamorphic-testing framework for ZK DSL toolchains. CIRCUZZ generates valid, semantics-preserving executions and reports crashes, rejected valid proofs, or inconsistent behavior. This oracle detects bugs visible during valid executions, but does not test whether invalid witnesses are rejected.
To support multiple ZK DSLs, CIRCUZZ generates programs in the intermediate language CIRCIL and translates them to each target language. A CIRCIL program contains inputs, outputs, and typed operations over field values and other DSL-level constructs. It is imperative and first-order, with assignments and Boolean assertions. Arithmetic is evaluated modulo the target field prime.
LIEZZ reuses this common program representation and its target-language translations. It changes the tested property from consistency across valid executions to rejection of invalid witnesses, and extends CIRCIL to generate the richer programs described in Section 5.
3 Overview
This section gives a high-level view of adversarial witness injection and the role of CIRCIL program generation. The core idea is to construct witnesses that are invalid by construction yet retain much of the structure of valid witnesses. This provides an oracle for whether a ZK DSL toolchain rejects executions that violate the source-program semantics.
3.1 Running Example
We illustrate adversarial witness injection with a real NOIR bug found by LIEZZ. Figure 2 shows a simplified version of a generated CIRCIL program and its NOIR translation. The program performs fixed-base scalar multiplication and branches on whether the resulting point is the point at infinity. The NOIR translation calls the corresponding standard-library routine and uses its is_infinite flag. Function support in CIRCIL is essential here: without it, LIEZZ could not generate programs that reach this routine.
For scalar 0, fixed-base scalar multiplication yields the point at infinity, so is_infinite should be true and the program should return 123. For scalar 1, it yields the curve generator, so the flag should be false and the program should return 42. The bug is that NOIR constrains the point coordinates but not their relationship with is_infinite, allowing the flag to be changed independently. The toolchain can therefore accept invalid witnesses, making this a soundness bug. We reported the bug, and the developers fixed it.
Consider two executions of the program. We write the relevant intermediate values as , , and , where and are the point coordinates and encodes is_infinite. On input , the routine returns the generator with , and the program returns 42:
On input , it returns the point at infinity, represented by coordinates with , and the program returns 123:
Both witnesses represent valid executions.
We call an adversarially constructed invalid witness a lying witness. LIEZZ constructs one by retaining the input and point coordinates from the first execution while taking the flag and output from the second:
The lying witness is invalid. It claims that input 1 produces the generator but also that this point is the point at infinity. No valid execution can satisfy both claims. A correct constraint system must therefore reject the witness. The buggy system accepts it because it constrains the coordinates but not their relationship with is_infinite.
The example illustrates two ingredients of LIEZZ. First, function support in CIRCIL generates programs that reach

Figure 3: LIEZZ workflow for adversarial witness injection. LIEZZ generates and translates a test program, compiles and executes it on pairs of inputs, and retains pairs with different outputs. It splices their witnesses to construct a lying witness. Rejection is expected; acceptance exposes a soundness bug, while a crash during compilation, witness generation, or processing of the injected witness exposes a completeness bug.
standard-library code. Second, adversarial witness injection exercises behavior absent from valid executions. Both and are valid, and the program behaves correctly on them. Only their adversarial combination exposes the bug. Sections 4 and 5 describe these ingredients in detail.
3.2 LIEZZ Workflow
Figure 3 shows how LIEZZ combines CIRCIL program generation, translation, input sampling, and adversarial witness injection. LIEZZ generates a CIRCIL program and translates it to a target ZK DSL. It then samples pairs of input assignments, compiles the translated program, and executes it on each assignment to obtain two witnesses. It retains only pairs whose outputs differ. Such pairs let LIEZZ combine an input with an output that cannot belong to the same execution of the deterministic program. Section 4.2 explains how LIEZZ constructs these input pairs.
For each retained pair, LIEZZ selects a witness-splicing strategy and constructs a lying witness. It then checks the witness with the target toolchain. Rejection is expected. Acceptance means that the toolchain accepted an execution that violates the source-program semantics, exposing a soundness bug. A crash during compilation, witness generation, or processing of the injected witness exposes a completeness bug.
4 Adversarial Witness Injection
This section presents adversarial witness injection in LIEZZ. The oracle relies on deterministic source semantics: for a fixed input assignment, executing the generated program determines its output. For adversarial-witness testing, LIEZZ generates programs with public inputs and outputs. It then tests whether the target toolchain correctly enforces this input-output relation.
4.1 Constructing Lying Witnesses
The oracle follows directly from determinism. Suppose LIEZZ executes a program P twice and obtains
with . Since is deterministic, cannot be the output of on input . Any witness combining with is therefore invalid, regardless of its intermediate values.
Let the two valid witnesses be
using the abstract witness notation from Section 2.2. LIEZZ constructs the lying witness
The input of comes from the first execution, while its output comes from the second. The function mix determines how intermediate values are selected from the two valid witnesses. We call the overall construction witness splicing and the choice encoded by mix the splicing strategy. Regardless of this choice, the combination of and makes invalid.
A correct toolchain must reject . We use acceptance for the target-specific outcome in which the injected witness passes the toolchain's check. Acceptance means that the toolchain has accepted an execution that cannot occur under the source-program semantics, so LIEZZ reports a soundness bug. If the toolchain crashes during compilation, while generating the original witnesses, or while processing the injected witness, LIEZZ reports a completeness bug.
4.2 Generating Diverging Executions
Before splicing witnesses, LIEZZ must obtain two valid executions whose outputs differ. A simple approach is to sample two unrelated inputs and and retain the pair if
. This is sufficient for the oracle, but often ineffective at exposing missing constraints.
Unrelated inputs can cause many computations to differ simultaneously. Even changing a single input can have this effect if the program uses it in several places. The resulting lying witness may then violate constraints unrelated to the missing constraint that LIEZZ is trying to expose. For example, suppose the same input is used in both a multiplication and an addition. Even if the multiplication constraint is missing, the addition constraint may reject a spliced witness because it still enforces consistent use of the changed input. The addition therefore masks the missing multiplication constraint.
LIEZZ instead tries to create a single controlled divergence point. During CIRCIL program generation, it selects one occurrence of an existing input and replaces that occurrence with a fresh fault input f. It then constructs two input assignments that agree on every ordinary input and differ only in the value assigned to f:
The two executions follow the same computation until reaching the selected occurrence of f, at which point their intermediate values may diverge. This controlled divergence localizes the differences between the witnesses. Constraints that do not depend on the occurrence are more likely to remain satisfied, while the lying witness still combines an input with an output that cannot belong to the same deterministic execution.
LIEZZ chooses the second value of by applying several mutation strategies. It tries local changes such as and , sign changes such as , special field values 0, 1, and , where is the field modulus, and random offsets. After executing the program on both assignments, LIEZZ retains the pair only if the public outputs differ. Pairs with equal outputs are discarded because they do not provide the required input-output contradiction.
4.3 Witness-Splicing Strategies
The construction in Section 4.1 fixes the inputs and outputs of the lying witness but leaves open how to choose its intermediate values. A missing constraint is most likely to be exposed when the lying witness preserves enough consistency to satisfy unaffected constraints while still combining values that cannot occur together in a valid execution.
The difficulty is that LIEZZ does not know which front-tend witness values are constrained together. Standard-library functions may produce several witness values, and a missing constraint may be exposed only by particular combinations from the two executions. The running example in Section 3.1 illustrates this challenge: exposing the NOIR bug requires retaining the point coordinates from one execution while taking the is_infinite flag from the other.
LIEZZ therefore supports several ways of instantiating . For each retained pair of executions, it selects a splicing strategy, constructs a lying witness, and checks the witness with the target toolchain. Each strategy relies on controlled divergence: the two executions agree until the selected use of the fault input f and may differ afterwards. We call the first intermediate position at which their witness values may differ the divergence point. Values before this point are copied from , because they are common to both executions. The strategies differ in how they choose values at and after the divergence point.
Divergence-point splicing. This strategy switches from to exactly at the divergence point. The lying witness retains the common prefix from the first execution and takes all remaining intermediate values from the second. This is the most direct instantiation of .
Shifted splicing. This strategy delays the switch from to by a small offset. The lying witness retains the common prefix and a bounded number of post-divergence values from , then takes the remaining intermediate values from . The offset is chosen from a bounded range.
Windowed splicing. This strategy defines a bounded window starting at the divergence point. Outside the window, the lying witness follows divergence-point splicing. Inside it, LIEZZ mixes values from and . In the uniform variant, each position is selected from either execution with a fixed probability. In the tapered variant, the probability of selecting values from decreases across the window, creating a gradual transition from the first execution to the second.
Suffix splicing. This strategy extends the mixing region from the divergence point to the end of the intermediate-value sequence. As with windowed splicing, LIEZZ uses uniform and tapered variants. Suffix splicing can therefore retain values from far beyond the divergence point rather than confining the mixture to a bounded window.
Together, these strategies explore abrupt, delayed, localized, and gradual transitions between the two executions. For each test, LIEZZ checks the lying witness constructed by the selected strategy and reports a soundness bug if the target toolchain accepts it.
5 Extending CIRCIL
Adversarial witness injection is most effective when generated programs exercise functionality beyond primitive arithmetic. Many bugs in ZK DSL toolchains occur in standard-library routines, conversions, parameterized operations, and other constructs that expand into many constraints and intermediate witness values. To reach such code, LIEZZ extends CIRCIL with typed function specifications, generation-time constraints, and supporting language constructs.
5.1 Function Specifications
The most important CIRCIL extension for LIEZZ is support for function specifications. In CIRCUZZ, generated programs were built primarily from primitive CIRCIL operations. This was sufficient for testing many toolchain behaviors, but limited the generated programs to functionality expressible directly in the base language. Many ZK DSLs, however, provide important functionality through standard-library routines, including curve operations, conversions, comparisons, decompositions, and hash functions. Bugs in these routines cannot be reached unless generated programs can call them. Such calls exercise both the source-level library implementations and their translation through later toolchain stages.
LIEZZ therefore extends CIRCIL with typed function specifications. A function specification describes the arguments and return values of a routine that may be called from a generated CIRCIL program. A target-specific translation maps the CIRCIL call to the corresponding standard-library routine or language construct in the target ZK DSL. This lets LIEZZ exercise functionality beyond the primitive CIRCIL operations while keeping program generation independent of target-language syntax.
Function specifications can also be parameterized. For example, an array-concatenation specification can be parameterized by an element type T and three length parameters N, M, and S:
Here, T is a generic type, N and M are the input-array lengths, and S is the output-array length. Their relationship is enforced by generation-time constraints, discussed in Section 5.2. When LIEZZ instantiates the specification, it chooses a concrete element type and concrete lengths that satisfy these constraints, then emits the corresponding CIRCIL call. Other specifications use parameters to select properties such as array lengths, integer widths, signedness, and element types.
Function support is central to several bugs found by LIEZZ. The example in Section 3.1 uses a generated call to a fixed-base scalar-multiplication routine. Without function specifications, LIEZZ could not generate the CIRCIL program that reaches this standard-library code. The same mechanism lets LIEZZ exercise other standard-library functionality, including conversions, hash functions, and scalar-field operations.
5.2 Generation-Time Constraints
Parameterized function specifications introduce a second challenge: not every choice of generic parameters describes a valid target-language call. Array sizes may need to be nonzero, integer widths may be restricted by the target toolchain, and relationships between parameters may need to hold. Without checking these conditions, many generated programs would fail for uninteresting type or configuration reasons before reaching the behavior under test.
LIEZZ therefore attaches generation-time constraints to function specifications. These constraints are evaluated during CIRCIL program generation, before a program is emitted. They restrict the generic values chosen when a parameterized specification is instantiated. They may impose constant bounds, such as requiring an array length to be at least one, or express relationships between multiple generic values.
For example, the array-concatenation specification from Section 5.1 has three length parameters: the input lengths N and M, and the output length S. A generated call is valid only when these parameters describe a consistent concatenation:
These constraints are checked during CIRCIL program generation, so LIEZZ emits only calls whose lengths satisfy target requirements. They are not source-level assertions and do not become part of the generated ZK DSL program. Instead, they guide generation and avoid invalid instantiations that would fail during type checking or configuration validation.
5.3 Additional Program Constructs
Function specifications require CIRCIL to represent the values consumed and produced by standard-library routines. In addition to field and Boolean values, LIEZZ therefore extends CIRCIL with bounded-size arrays. Arrays may appear as program inputs and outputs, as function arguments, and as return values. The generator can construct array literals, assign whole arrays, read or update individual elements, and initialize arrays element by element.
Arrays are especially useful for functions whose natural interface is not a single field element. For example, list operations, hash functions, and field-to-bit or field-to-byte conversions operate on collections of values. Combined with generic function specifications, arrays let one specification range over both the element type and the array length, as in the concat example from Section 5.1.
LIEZZ also adds let expressions, which introduce expression-local bindings. Unlike statement-level assignments, a let expression evaluates to a value and can therefore appear within a larger expression. This lets the generator create additional intermediate values and more structured expressions. For NOIR, the translation randomly chooses between introducing an intermediate variable and encoding the let expression as an inline closure. The latter exercises target-language machinery not reached by ordinary statement-level assignments.
6 Evaluation
We evaluate LIEZZ on four ZK DSL toolchains: CIRCOM, CORSET, GNARK, and NOIR. Our evaluation addresses five research questions:
RQ1: How effective is LIEZZ at finding soundness and completeness bugs?
RQ2: What kinds of bugs does adversarial witness injection expose?
RQ3: How reliably and quickly does LIEZZ rediscover the reported bugs?
RQ4: What does adversarial witness injection expose beyond CIRCUZZ's metamorphic-testing oracle?
RQ5: How do the new CIRCIL program-generation features affect bug-finding effectiveness?
6.1 Experimental Setup
Target toolchains. We evaluate LIEZZ on CIRCOM, CORSET, GNARK, and NOIR. These toolchains differ in their source languages and workflows. For each toolchain, LIEZZ excludes source constructs that intentionally leave values unconstrained, such as CIRCOM's unconstrained assignments. For CIRCOM, we additionally exclude operations that cannot be expressed automatically as quadratic constraints.
Our CORSET integration targets the zkASM language, whereas CIRCUZZ targeted CORSET's Lisp-like constraint language [2]. A zkASM program is compiled into a constraint system and executed to produce an execution trace that serves as the witness. Unlike the other evaluated toolchains, CORSET does not produce a cryptographic proof in our workflow. Instead, we use its checker to determine whether a generated or injected trace satisfies the compiled constraints.
In adversarial-witness campaigns, generated program inputs and outputs are public for CIRCOM, GNARK, and NOIR; zkASM does not distinguish public from private values.
Witness representations. CIRCOM and NOIR expose witnesses as flat arrays whose entries can be mapped to inputs, outputs, and intermediate values. GNARK also uses a flat witness array, but does not expose the full array through its public interface. We therefore modify GNARK to extract the intermediate witness values and to supply an injected witness during proving.
CORSET instead represents its witness as a two-dimensional trace. We adapt the witness-splicing strategies from Section 4.3 to combine two valid traces. Because CORSET can check candidate traces quickly without generating a proof, we additionally use a brute-force strategy that constructs many candidate traces from values in the two valid executions. Each candidate preserves the required input-output contradiction and is submitted to the checker to determine whether the compiled constraints accept it.
Generated programs. We generate relatively small CIRCIL programs to maximize testing throughput. The default configuration uses one or two inputs, up to two outputs, and expressions with a maximum depth of four. In adversarial-witness campaigns, we disable explicit CIRCIL assertions because a failed assertion would prevent LIEZZ from obtaining the two valid executions needed to construct a lying witness.
Toolchain versions. We used the latest main-branch version of each toolchain available at the time of testing, together with release or main-branch versions of separate prover components.
Hardware. The experiments were run on a machine with an AMD EPYC 9474F processor and 1.5 TB of memory, running Debian GNU/Linux 13 (trixie).
6.2 RQ1: Bugs Found
We conducted open-ended bug-finding campaigns as we added support for each toolchain. If a detected bug prevented further testing, we paused the campaign until the bug was fixed or worked around. These exploratory campaigns establish the set of discovered bugs but are not used for quantitative comparisons between toolchains. Table 1 summarizes the bugs found by LIEZZ. The Bug column identifies each bug and links to the corresponding public report or advisory when available; an unlinked number denotes a bug without a public report. The Fix column identifies the fix. Linked letters point to public pull requests or commits. A dash indicates that no fix is available.
The Type column records the impact of the bug: soundness, completeness, or both. The Signal column records the observation that exposed the bug. For soundness bugs, the signal is that the toolchain accepted an injected witness that should have been rejected. For completeness bugs, possible signals include a crash during compilation, while generating the original witnesses, or while processing the injected witness. For CORSET, processing the injected witness means checking the trace against the generated constraints; rejection of a valid trace is also a completeness signal.
Overall, LIEZZ found 13 bugs across the four evaluated toolchains: five soundness bugs, six completeness bugs, and two bugs with both soundness and completeness impact. Six of the seven bugs with soundness impact were exposed when the toolchain accepted a lying witness. Bug 13 was first observed as a crash but can also cause a soundness failure. The bugs affect several major parts of the tested toolchains, including compilers, witness generators, provers, and constraint-system checkers for CORSET.
The soundness bugs are the most security-critical results. In proof-producing workflows, they allow a malicious prover to produce a proof that verifies for a witness that does not match the source-program semantics. Such bugs can directly undermine applications that rely on ZK proofs for authorization, asset transfers, membership checks, or other security-sensitive decisions. Completeness bugs are less directly exploitable, but still matter in deployed systems: they can prevent users from compiling programs, generating witnesses, or producing proofs that verify, and can therefore cause denial of service in protocols that depend on timely proof generation.
All bugs with soundness impact in Table 1 except bug 2 were fixed by the corresponding developers. The remaining
Table 1: Bugs found by LIEZZ. Linked bug numbers point to public reports or advisories, and linked fix letters point to public pull requests or commits.
| Bug | Fix | Toolchain | Type | Signal | Description |
|---|---|---|---|---|---|
| 1 | A | CIRCOM | both | accepted lie | Sign flip in R1CS-to-Plonk constraint translation. |
| 2 | - | CORSET | soundness | accepted lie | Incorrect culling of complex constraints. |
| 3 | B | CORSET | soundness | accepted lie | Missing constraints after return statements. |
| 4 | C | CORSET | completeness | check crash | Checker error during limb-width calculation. |
| 5 | - | CORSET | completeness | compile crash | Compiler crash on small fields. |
| 6 | - | CORSET | completeness | check rejection | Valid traces rejected by generated constraints. |
| 7 | D | GNARK | soundness | accepted lie | Unconstrained hints in curve scalar multiplication. |
| 8 | E | GNARK | completeness | compile crash | Crash on effectively constant lookup entry. |
| 9 | F | NOIR | soundness | accepted lie | Incorrect lowering of large ACIR constraints. |
| 10 | G | NOIR | soundness | accepted lie | Unconstrained is_infinite flag in curve points. |
| 11 | H | NOIR | completeness | compile crash | Crash when exporting verification key. |
| 12 | I | NOIR | completeness | compile crash | Assertion error during scalar decomposition. |
| 13 | J | NOIR | both | witness crash | Incorrect removal of cast statements. |
issue is a confirmed CORSET MIR bug. The developers indicated that this issue is not a priority because the affected representation is not used in production.
6.3 RQ2: Bug Characteristics
This section characterizes the bugs found by LIEZZ. We focus primarily on the bugs with soundness impact, because they are the most security-critical results and the main target of adversarial witness injection. We discuss completeness bugs where they illustrate a distinct failure mode or show the importance of the new CIRCIL program-generation features.
Underconstrainedness. The main pattern is that the soundness bugs found through accepted injected witnesses are underconstrainedness bugs: the generated constraints accept more witnesses than the source-program semantics permits. In such cases, valid executions can still behave correctly, because the toolchain accepts all valid witnesses. The bug becomes visible only when LIEZZ supplies an invalid witness that preserves enough structure to satisfy the existing constraints while violating the source-level input-output relation.
The soundness bugs occur in different parts of the tested toolchains. In CORSET, bugs 2 and 3 produce constraint systems that are too weak: one incorrectly culls complex constraints, while the other omits constraints needed after return statements. In GNARK, bug 7 affects a standard-library curve operation whose hint-based scalar decomposition can be satisfied by malicious witness values. In NOIR, bug 9 weakens constraints when Barretenberg lowers ACIR, NOIR's intermediate representation, into backend constraints. Bug 10, the running example from Section 3.1, leaves the is_infinite flag unconstrained with respect to the point coordinates.
Most bugs exposed by accepted injected witnesses are missing-constraint rather than wrong-constraint bugs. The fixes therefore add constraints or prevent invalid values from being used, rather than changing the semantics of valid executions. This explains why semantics-preserving testing, as in CIRCUZZ, is not expected to expose them: if valid witnesses are accepted and produce the expected outputs, an oracle based only on valid executions has no disagreement to observe. Bug 1 is the main exception. It is caused by a sign error when the CIRCOM prover converts R1CS constraints into its internal Plonk representation, so it can both accept invalid witnesses and reject valid ones.
Witness-splicing behavior. The bugs show why LIEZZ uses controlled divergence and multiple witness-splicing strategies. The successful strategy depends on how much post-divergence consistency the buggy constraint system requires, and on whether the fault-input mutation reaches an edge case. Some bugs are exposed by switching from one execution to the other. Bug 7 is exposed by divergence-point splicing, typically with a mutation that makes one execution use scalar zero. This matches the structure of the bug, because the curve operation has an exceptional scalar-zero case.
In contrast, bug 10 requires a more selective combination of intermediate values. LIEZZ must keep the point coordinates from one execution while taking the is_infinite flag and output from the other. Accordingly, successful tests use shifted, windowed, or suffix splicing rather than divergence-point splicing, together with fault-input mutations to special field values such as zero. These strategies can keep post-divergence values from the first execution while changing others, which is necessary when the missing constraint relates only part of a larger structured value.
Bug 9 shows strategy-insensitive underconstrainedness. All witness-splicing strategies and many fault-input mutations ex-pose it. This reflects the bug’s severity: the toolchain accepts many combinations of witness values that do not correspond to valid source-level executions.
Two further bugs were rediscovered only rarely. Bug 1 was rediscovered only in the ablated LIEZZ configuration evaluated in RQ5. The successful test used the sign-changing mutation and divergence-point splicing. Bug 3 was rediscovered once with the full configuration (RQ3) and once with the ablated configuration (RQ5), both using the brute-force trace strategy. The successful tests used and , respectively.
Standard-library reachability. Standard-library functionality is a source of security bugs. Bugs 7 and 10 both affect elliptic-curve operations and require programs to call library routines. They would not be reachable with the base CIRCIL program generation, which did not emit calls to standard-library routines. The crash bugs show a related pattern for completeness: bug 8 involves lookup tables, while bug 11 is triggered by redundant target-level assertions that can arise from richer expressions and standard-library calls, and bug 12 requires elliptic-curve scalar operations. These bugs motivate the CIRCIL extensions from Section 5: without function specifications and richer programs, LIEZZ would not exercise the library routines and expression patterns that trigger several of the bugs in Table 1.
Mixed soundness and completeness impact. Finally, the table includes two bugs with both soundness and completeness impact. Bug 1 accepts witnesses satisfying an incorrect sign-flipped constraint and rejects witnesses satisfying the intended constraint. Bug 13 was first observed through a crash, but the underlying cast-removal bug can also produce incorrect constraints. These cases show that the boundary between soundness and completeness is not always tied to a single symptom: the same root cause can both reject valid executions and accept invalid ones, depending on how it is triggered.
6.4 RQ3: Time to Bug
This section evaluates how quickly LIEZZ rediscovers the bugs from Table 1. We focus on bugs with developer-provided fixes. This gives us a patch-based oracle for recognizing rediscoveries: a test counts as a rediscovery of a target bug only if it exhibits the target behavior on the vulnerable version and no longer exhibits that behavior on the patched version. This filtering helps distinguish rediscoveries of the target bug from other failures exposed during the same campaign.
For each fixed bug, we ran ten campaigns with random seeds. Each campaign used one core and a seven-day timeout. For each campaign, we measure the time until LIEZZ first produces the same kind of observation that originally exposed the target bug: an accepted injected witness for bugs originally exposed through such witnesses, and a crash or rejection for bugs originally exposed through completeness failures. We report the number of successful seeds and the minimum, median, and maximum values for both time to bug and number of generated CIRCIL programs among successful campaigns.
Table 2 summarizes the results. The full LIEZZ configuration rediscovers four of the five fixed bugs originally exposed through accepted injected witnesses within the timeout (above the horizontal line). Bugs 7 and 9 are rediscovered in all ten seeds. Bug 1 is not rediscovered by the full configuration, but the ablated configuration in RQ5 rediscovers it once.
The bugs exposed through accepted injected witnesses vary substantially in how reliably they are rediscovered. Bugs 7 and 9 are rediscovered in all ten campaigns, but for different reasons. Bug 7 is exposed by a simple lying witness: successful tests use divergence-point splicing and typically make one execution use scalar zero. Bug 9 is an underconstrainedness issue in the lowering of large ACIR constraints. Successful tests expose it with all splicing strategies and many fault-input mutations, which explains why it is the fastest soundness bug to find, with a median time to bug of 1h 21m.
The remaining bugs in this group are harder to rediscover. Bug 10 is found in nine of ten seeds, with a median time to bug of 3d 01h 23m. This matches the structure of the bug: LIEZZ must generate a call to the relevant elliptic-curve routine, sample inputs that produce different outputs, and splice the witness so that the point coordinates remain consistent while the is_infinite flag and output come from the other execution. Successful tests require shifted, windowed, or suffix splicing rather than divergence-point splicing.
The bugs originally exposed through crashes or rejections (below the horizontal line) are also rediscovered at different rates. Bugs 4, 8, and 11 are found in all ten campaigns. Bug 4 is the easiest: the median campaign finds it in less than one minute after generating 19 CIRCIL programs. Bugs 8 and 11 take longer, with median times of 2h 14m and 2h 35m.
Bug 12 is not rediscovered in any campaign within the seven-day timeout. It requires both the exact scalar value and a specific surrounding expression that causes NOIR to represent one part of the scalar decomposition as a variable and the other as a constant.
Bug 13 is rediscovered in two of ten campaigns, with a median time to bug of 5d 03h 53m. The bug incorrectly removes casts, but this causes a crash only when the uncast value is later used by an operation that requires the casted type, such as a bitwise operation on a u128. In many generated programs, removing the cast instead changes the computed value without causing a crash. The advisory shows that the bug can also cause a soundness failure, but adversarial witness injection does not expose this behavior. Cast removal occurs before witness generation, so the initial executions already reflect the miscompiled program. The oracle therefore lacks the valid source-level executions needed to construct a lying witness for this failure.
Overall, the full configuration rediscovers four of the five fixed bugs originally exposed through accepted injected witnesses, while RQ5 shows that adversarial witness injection
Table 2: Time to bug for fixed bugs. The Seeds column reports the number of successful campaigns out of ten. Time and CIRCIL programs report minimum/median/maximum values among successful campaigns; sub-minute times are shown as <1m. Bugs above the horizontal line were originally exposed through accepted injected witnesses; bugs below it were originally exposed through crashes or rejections.
| Bug | Toolchain | Seeds | Time to bug | CIRCIL programs | ||||
|---|---|---|---|---|---|---|---|---|
| Min. | Med. | Max. | Min. | Med. | Max. | |||
| 1 | CIRCOM | 0 / 10 | - | - | - | - | - | - |
| 3 | CORSET | 1 / 10 | 6d 12h 32m | 6d 12h 32m | 6d 12h 32m | 273,132 | 273,132 | 273,132 |
| 7 | GNARK | 10 / 10 | 1h 22m | 4h 09m | 23h 28m | 1,236 | 3,857 | 21,865 |
| 9 | NOIR | 10 / 10 | 10m | 1h 21m | 4h 18m | 528 | 3,865 | 12,742 |
| 10 | NOIR | 9 / 10 | 9h 00m | 3d 01h 23m | 6d 19h 51m | 15,098 | 123,584 | 279,353 |
| 4 | CORSET | 10 / 10 | <1m | <1m | 3m | 1 | 19 | 98 |
| 8 | GNARK | 10 / 10 | 14m | 2h 14m | 3h 19m | 206 | 2,041 | 3,228 |
| 11 | NOIR | 10 / 10 | 15m | 2h 35m | 11h 32m | 378 | 4,399 | 19,012 |
| 12 | NOIR | 0 / 10 | - | - | - | - | - | - |
| 13 | NOIR | 2 / 10 | 3d 08h 12m | 5d 03h 53m | 6d 23h 34m | 142,009 | 221,024 | 300,039 |
can also rediscover bug 1. Rediscovery probability nevertheless varies substantially. Bug 7 requires only divergence-point splicing, while bug 9 occurs frequently in generated programs. Both are therefore rediscovered consistently. Bugs requiring a rarer program shape, a specific fault-input mutation, or careful intermediate-value splicing are less reliable. The time-to-bug results measure the combined effectiveness of three parts of LIEZZ: generating a program that reaches the relevant operation, sampling an input pair with different outputs, and constructing an injected witness that preserves enough structure to expose the missing or incorrect constraint.
6.5 RQ4: Beyond CIRCUZZ
This section compares adversarial witness injection with CIRCUZZ's valid-execution oracle. The two oracles target different behaviors: CIRCUZZ checks valid, semantics-preserving executions, whereas adversarial witness injection checks whether invalid witnesses are rejected. We use the same fixed bugs, ten-seed campaign setup, seven-day timeout, and patch-based rediscovery criterion as in Section 6.4. The only change is the oracle: instead of injecting adversarial witnesses, these campaigns use CIRCUZZ's metamorphic-testing oracle.
Table 3 reports the CIRCUZZ results. The upper part contains bugs originally exposed through accepted injected witnesses, while the lower part contains bugs originally exposed through crashes or rejections. The table also compares the number of successful campaigns and, where both configurations succeed, the median time and number of generated CIRCIL programs with the full LIEZZ results from Table 2.
The main result is that CIRCUZZ does not expose any of the soundness failures revealed by accepted injected witnesses. It does not rediscover bugs 3, 7, 9, or 10. These are underconstrainedness bugs for which valid executions provide no disagreement for a metamorphic oracle to observe.
Bug 1 is different because the same sign error can both accept invalid witnesses and reject valid ones. CIRCUZZ rediscovers the root cause once through a completeness failure, but does not expose its soundness impact. Conversely, the ablated LIEZZ configuration in RQ5 rediscovers the soundness failure once. The single rediscovery by each configuration suggests that the bug is difficult to reach within the seven-day budget and that rediscovery is highly dependent on the random seed.
For bugs originally exposed through completeness failures, the picture is different. CIRCUZZ rediscovers bugs 4, 8, 11, and 13 in all ten campaigns. The corresponding LIEZZ campaigns also rediscover bugs 4, 8, and 11 in all ten seeds, but their relative efficiency varies. For bug 4, CIRCUZZ uses fewer CIRCIL programs, although its median time is higher. For bug 8, it reduces the median time by and the number of generated CIRCIL programs by . For bug 11, it increases them by and , respectively.
Bug 13 differs primarily in reliability. CIRCUZZ rediscovers it in all ten campaigns, eight more than LIEZZ. As discussed in Section 6.4, the cast-removal bug can affect valid executions, making it well matched to CIRCUZZ's oracle. The table also shows lower median time and program count for CIRCUZZ, but these medians cover ten successful campaigns for CIRCUZZ and only two for LIEZZ. They therefore do not support a direct comparison of speed.
The only fixed bug originally exposed through a completeness failure that CIRCUZZ does not rediscover is bug 12. As discussed in Section 6.4, its rare trigger also prevents LIEZZ from rediscovering it within the seven-day timeout.
Overall, adversarial witness injection exposes soundness failures that the valid-execution oracle does not. CIRCUZZ produces no rediscoveries for bugs 3, 7, 9, and 10, which are
Table 3: Time to bug for CIRCUZZ. The Seeds column reports the number of successful campaigns out of ten. Time and CIRCIL programs report minimum/median/maximum values among successful campaigns; sub-minute times are shown as <1m. The annotations beside Seeds and the median columns show changes relative to the full LIEZZ configuration in Table 2. Bugs above the horizontal line were originally exposed through accepted injected witnesses; bugs below it were originally exposed through crashes or rejections.
| Bug | Seeds | Time to bug | CIRCIL programs | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Min. | Med. | Max. | Min. | Med. | Max. | |||||
| 1 | 1 / 10 | +1 | 6d 17h 11m | 6d 17h 11m | 6d 17h 11m | 193,858 | 193,858 | 193,858 | ||
| 3 | 0 / 10 | -1 | - | - | - | - | - | - | ||
| 7 | 0 / 10 | -10 | - | - | - | - | - | - | ||
| 9 | 0 / 10 | -10 | - | - | - | - | - | - | ||
| 10 | 0 / 10 | -9 | - | - | - | - | - | - | ||
| 4 | 10 / 10 | = | <1m | 1m | +67% | 5m | 1 | 11 | -42% | 24 |
| 8 | 10 / 10 | = | 9m | 31m | -77% | 5h 15m | 140 | 611 | -70% | 6,014 |
| 11 | 10 / 10 | = | 9m | 7h 11m | +178% | 1d 13h 45m | 378 | 18,380 | +318% | 94,635 |
| 12 | 0 / 10 | = | - | - | - | - | - | - | ||
| 13 | 10 / 10 | +8 | 4m | 45m | -99% | 6h 30m | 152 | 1,851 | -99% | 16,102 |
pure underconstrainedness bugs. It rediscovers bug 1 through a completeness failure, but does not expose its soundness impact. For bugs 4, 8, and 11, whose completeness failures are visible during valid executions, both approaches rediscover the bugs reliably, with no consistent efficiency advantage.
6.6 RQ5: Effect of CIRCIL Extensions
This section evaluates how much the new CIRCIL program-generation features contribute to the results. We repeated the time-to-bug experiments from Section 6.4 with an ablated configuration that disables arrays, let expressions, and function specifications. We evaluated the ablation with both adversarial witness injection and CIRCUZZ's metamorphic-testing oracle. This separates the effect of richer program generation from that of the oracle.
Table 4 reports the ablated results. Each entry reports how many of ten random seeds rediscovered the target bug. For successful campaigns, the table also reports the median time to bug and median number of generated CIRCIL programs. The annotations compare the seed counts and medians with the corresponding full configurations from Tables 2 and 3.
The clearest ablation effects occur for bugs that require operations introduced through function specifications. As discussed in Section 6.3, bugs 7 and 10 require generated programs to call elliptic-curve library routines, while bug 8 involves lookup functionality. The ablated LIEZZ configuration cannot generate the relevant calls and therefore does not rediscover any of these bugs. Bug 12 also requires an elliptic-curve scalar operation. The ablated configuration cannot reach this operation at all, while the full configuration also fails to rediscover the bug because of its rare trigger.
The remaining bugs originally exposed through accepted injected witnesses do not depend on standard-library calls, and their ablation results are more mixed. Bug 9 is rediscovered in all ten campaigns with both configurations. However, the ablated configuration reduces the median time by and the number of generated CIRCIL programs by . A plausible explanation is that disabling the new features produces simpler generated programs in which the constraint structure needed to expose this general ACIR-lowering bug occurs more frequently.
Bug 1 is not rediscovered by the full LIEZZ configuration but is rediscovered once by the ablated configuration. This isolated success does not indicate that the ablation improves effectiveness: the bug is difficult to reach, and its rediscovery appears highly dependent on the random seed. Bug 3 is rediscovered once by each configuration. Although the successful ablated campaign is faster and generates fewer CIRCIL programs, one successful campaign per configuration does not support a meaningful efficiency comparison.
Among the bugs originally exposed through crashes or rejections, only bug 4 remains reliably rediscoverable by the ablated LIEZZ configuration. It is found in all ten campaigns, with a median time below one minute. This is expected: the CORSET checker bug does not require any of the added language features.
Bug 11 is not rediscovered by the ablated configuration. As discussed in Section 6.3, the bug is triggered by redundant target-level assertions that can arise from richer expressions and standard-library calls. Without the new CIRCIL features, this pattern is effectively unreachable.
Bug 13 is rediscovered twice by the full configuration but not by the ablated configuration. The full configuration includes custom function specifications whose translations introduce additional casts, substantially increasing the opportu-
Table 4: Effect of disabling the new CIRCIL program-generation features. Each entry reports the number of successful ablated campaigns out of ten. Time and CIRCIL programs report medians over successful ablated campaigns; sub-minute median times are shown as <1m. The annotations beside the seed counts and medians show changes relative to the corresponding full configuration in Tables 2 and 3.
| Bug | LIEZZ ablated | CIRCUZZ ablated | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Seeds | Time | CIRCIL programs | Seeds | Time | CIRCIL programs | |||||||
| 1 | 1 / 10 | +1 | 6d 20h 45m | 53,133 | 1 / 10 | = | 2d 16h 04m | -60% | 80,804 | -58% | ||
| 3 | 1 / 10 | = | 4d 02h 55m | -37% | 186,141 | -32% | 0 / 10 | = | - | - | ||
| 7 | 0 / 10 | -10 | - | - | 0 / 10 | = | - | - | ||||
| 9 | 10 / 10 | = | 16m | -80% | 887 | -77% | 0 / 10 | = | - | - | ||
| 10 | 0 / 10 | -9 | - | - | 0 / 10 | = | - | - | ||||
| 4 | 10 / 10 | = | <1m | -50% | 21 | +11% | 10 / 10 | = | <1m | -13% | 11 | = |
| 8 | 0 / 10 | -10 | - | - | 0 / 10 | -10 | - | - | ||||
| 11 | 0 / 10 | -10 | - | - | 0 / 10 | -10 | - | - | ||||
| 12 | 0 / 10 | = | - | - | 0 / 10 | = | - | - | ||||
| 13 | 0 / 10 | -2 | - | - | 10 / 10 | = | 7h 58m | +962% | 20,171 | +990% | ||
nities to trigger this cast-removal bug.
The ablated CIRCUZZ results show that the new CIRCIL features also help metamorphic testing. For the bugs originally exposed through accepted injected witnesses, neither CIRCUZZ configuration exposes a soundness failure. Bug 1 remains the exception at the level of the root cause: both configurations rediscover it once through a completeness failure, but neither exposes its soundness impact.
For bugs originally exposed through completeness failures, bug 4 remains easy to rediscover, while bugs 8 and 11 disappear when the new CIRCIL features are disabled. Bug 12 is not rediscovered by either configuration.
Bug 13 remains reliable in the ablated CIRCUZZ configuration, but its median time increases from 45 minutes to almost eight hours, and its median program count increases by 990%. As with the LIEZZ ablation, this is consistent with the new function specifications creating more opportunities to trigger the bug.
Overall, the ablation shows that richer program generation expands the bugs reachable by both oracles. Function specifications are essential for reaching bugs in elliptic-curve and lookup functionality and create additional opportunities to trigger cast-related bugs. The new features also appear important for generating the pattern behind bug 11. Conversely, simpler programs can make lower-level bugs that do not require the new features faster to rediscover, as illustrated by bug 9. The extensions therefore broaden the tested functionality, although they do not uniformly reduce time to bug.
6.7 Threats to Validity
Our results depend on the ZK toolchains under test, their versions and configurations, and the LIEZZ configuration. We reduce this threat by evaluating four toolchains that differ in their source languages, witness representations, and proving or checking workflows. We also compare multiple configurations: adversarial witness injection, CIRCUZZ's metamorphic-testing oracle, and ablated variants without the new CIRCIL features. Because the ablation disables arrays, let expressions, and function specifications together, it measures their combined effect. We attribute individual results to function specifications only when the relevant operations cannot be generated without them.
Fuzzing is randomized, and the time needed to rediscover a bug can vary substantially across seeds. We account for this by running ten independent campaigns for each fixed-bug experiment and by reporting the number of successful seeds and the minimum, median, and maximum time to bug and number of generated CIRCIL programs. These values are computed only over successful campaigns. Comparisons are therefore most informative when configurations have similar success counts; in other cases, we treat the reported values descriptively rather than as evidence of relative efficiency.
The adversarial-witness oracle assumes deterministic source semantics and that the generated program is intended to constrain its public input-output relation. If a source construct intentionally leaves values unconstrained, acceptance of an injected witness may be expected rather than indicate a toolchain bug. We therefore generate programs with public inputs and outputs, exclude features such as CIRCOM's unconstrained assignments, and manually inspect reported soundness bugs.
False negatives remain possible. Coverage depends on the generated programs, sampled inputs, witness-splicing strategies, and target-specific operations supported by the current implementation. Bugs that require rare program shapes, spe-cific constants, standard-library routines that LIEZZ cannot yet generate, or combinations of intermediate values not produced by the supported witness-splicing strategies may not be exposed within the campaign timeout.
7 Related Work
Related work spans compiler testing, testing ZK systems, testing and analyzing ZK circuits, and formal verification of ZK compilers.
Testing compilers. Compiler testing commonly applies differential or metamorphic oracles to generated programs or to mutations of existing programs [9]. These techniques have been applied across compiler domains, including conventional [21,32], graphics-shader [11], and MPC compilers [29].
Testing ZK systems. Compiler-testing techniques have also been adapted to ZK systems, whose toolchains combine DSL compilers, witness generators, provers, and verifiers. CIRCUZZ [14] applies metamorphic testing end to end to ZK DSL toolchains, while MTZK [31] focuses on ZK compilers. Both test semantics-preserving executions and can expose bugs whose effects are observable during such executions, but do not directly test whether invalid witnesses are rejected. Chaliasos et al. identify constructing invalid witnesses without violating unrelated constraints as an open challenge [7]. LIEZZ addresses this challenge by splicing witnesses from valid executions with different outputs, yielding witnesses that cannot correspond to valid source-level executions.
ARGUZZ [15] simulates a malicious prover, combining metamorphic testing with fault injection inside zkVM provers. LIEZZ instead constructs invalid witnesses from valid executions and injects them into ZK DSL toolchains. SNARKProbe [12] combines dynamic analysis, fuzzing, and SMT solving to test cryptographic libraries and prover implementations. LIEZZ instead tests generated DSL programs through the complete toolchain.
Testing and analyzing ZK circuits. Kolozyan et al. [19] systematize security tools for zero-knowledge systems and evaluate six automated tools on 70 real-world vulnerabilities. They find that current tools focus mainly on CIRCOM and non-determinism, with weaker support for semantic mismatches and newer DSLs. Their study characterizes the broader tooling landscape; LIEZZ contributes a new testing oracle for complete ZK DSL toolchains.
A complementary line of work targets vulnerabilities in ZK application circuits rather than toolchain infrastructure. Chaliasos et al. distinguish circuit-level bugs, often introduced by circuit developers, from infrastructure bugs in compilers and proof-system implementations [8]. Circuit-level approaches use fuzzing [13,28], SMT-based analysis [16,17,25–27], and static or value-inference analyses [18,20,30]. Other work uses refinement types to certify properties of circuits generated from a dedicated language [23].
These techniques analyze source circuits, compiled constraint systems, or the consistency between witness computation and constraints. LIEZZ instead tests whether the complete toolchain accepts invalid witnesses. The two lines of work are complementary: circuit-level analyses may detect bugs already present in the source circuit or compiled constraint system, including standard-library bugs that affect the generated constraints. They do not target bugs introduced later in the toolchain. For example, in bug 1, the generated R1CS is correct but its conversion inside the prover introduces a sign error; in bug 9, the ACIR is correct but the prover backend drops constraints during lowering.
Formal verification of ZK compilers. Formal verification has produced strong correctness guarantees for general-purpose compilers, most notably CompCert [22]. Similar techniques have been applied to ZK compilation. ZKCrypt compiles high-level proof goals into implementations of zero-knowledge protocols and formally verifies the security of the generated implementations [5]. Ozdemir et al. partially verify the field-blasting pass of the CirC compiler using bounded SMT verification [24]. These approaches provide stronger guarantees for the verified components, whereas LIEZZ tests complete toolchains, including unverified components and their integration.
8 Conclusion
ZK DSL toolchains must reject witnesses that violate source-program semantics. We introduced adversarial witness injection, which constructs invalid witnesses by splicing executions with different outputs. Controlled divergence and splicing strategies expose missing constraints, while function specifications reach standard-library code.
Across four toolchains, LIEZZ found 13 bugs, seven with soundness impact; six were exposed by accepted injected witnesses. These bugs span compilers, witness generation, constraint lowering, standard libraries, and prover backends. Under the same budget, CIRCUZZ exposed none of the soundness failures but remained effective for completeness bugs.
Adversarial witness injection turns the oracle problem into a construction problem: LIEZZ constructs witnesses known to violate source-program semantics and tests whether the toolchain rejects them. It complements valid-execution testing by testing not only what systems accept, but also what they must reject.
Acknowledgments
We are grateful to the ZK DSL toolchain developers for their valuable help. This work was funded by the Austrian Science Fund (FWF) [Grant ID: 10.55776/DOC1345324] as well as by the Vienna Science and Technology Fund (WWTF) and the City of Vienna [Grant ID: 10.47379/ICT22007].
References
[1] A port of the Corset tool into Go. https://github.com/LFDT-Lineth/zkc.
[2] Corset. https://github.com/Consensys/corset.
[3] gnark: A fast zk-SNARK library that offers a high-level API to design circuits. https://docs.gnark.consensys.io.
[4] Noir. https://noir-lang.org.
[5] José Bacelar Almeida, Manuel Barbosa, Endre Bangerter, Gilles Barthe, Stephan Krenn, and Santiago Zanella-Béguelin. Full proof cryptography: Verifiable compilation of efficient zero-knowledge protocols. In CCS, pages 488–500. ACM, 2012.
[6] Marta Bellés-Muñoz, Miguel Isabel, Jose Luis Muñoz-Tapia, Albert Rubio, and Jordi Baylina Melé. Circom: A circuit description language for building zero-knowledge applications. Trans. Dependable Secur. Comput., 20:4733–4751, 2023.
[7] Stefanos Chaliasos, Imam Al-Fath, and Alastair F. Donaldson. Towards fuzzing zero-knowledge proof circuits (short paper). In ISSTA Companion, pages 98–104. ACM, 2025.
[8] Stefanos Chaliasos, Jens Ernstberger, David Theodore, David Wong, Mohammad Jahanara, and Benjamin Livshits. SoK: What don’t we know? Understanding security vulnerabilities in SNARKs. In Security. USENIX, 2024.
[9] Junjie Chen, Jibesh Patra, Michael Pradel, Yingfei Xiong, Hongyu Zhang, Dan Hao, and Lu Zhang. A survey of compiler testing. Comput. Surv., 53:4:1–4:36, 2020.
[10] Tsong Yueh Chen, S. C. Cheung, and Siu-Ming Yiu. Metamorphic testing: A new approach for generating next test cases. Technical Report HKUST-CS98-01, HKUST, 1998.
[11] Alastair F. Donaldson, Hugues Evrard, Andrei Lascu, and Paul Thomson. Automated testing of graphics shader compilers. PACMPL, 1:93:1–93:29, 2017.
[12] Yongming Fan, Yuquan Xu, and Christina Garman. SNARKProbe: An automated security analysis framework for zkSNARK implementations. In ACNS, volume 14584 of LNCS, pages 340–372. Springer, 2024.
[13] Rong Fu, Jia Yee Tan, Wenxin Zhang, Youjin Wang, Ziyu Kong, Zeli Su, Zhaolu Kang, Shuning Zhang, Xianda Li, Kun Liu, and Simon Fong. zkCraft: Prompt-guided LLM as a zero-shot mutation pattern oracle for
TCCT-powered ZK fuzzing. CoRR, abs/2602.00667, 2026.
[14] Christoph Hochrainer, Anastasia Isychev, Valentin Wüstholz, and Maria Christakis. Fuzzing processing pipelines for zero-knowledge circuits. In CCS, pages 783–797. ACM, 2025.
[15] Christoph Hochrainer, Valentin Wüstholz, and Maria Christakis. Arguzz: Testing zkVMs for soundness and completeness bugs. In Security, pages 1807–1826. USENIX, 2026.
[16] Miguel Isabel, Clara Rodríguez-Núñez, and Albert Rubio. Scalable verification of zero-knowledge protocols. In SP, pages 1794–1812. IEEE Computer Society, 2024.
[17] Jinan Jiang, Xinghao Peng, Jinzhao Chu, and Xiapu Luo. ConsCS: Effective and efficient verification of Circom circuits. In ICSE, pages 616–628. IEEE Computer Society, 2025.
[18] Jinan Jiang, Haoran Qin, and Xiapu Luo. ScaleCirc: Scaling the analysis over Circom circuits. In ASE, pages 1464–1476. IEEE Computer Society, 2025.
[19] Arman Kolozyan, Tom Sorger, Alexander Hicks, and Stefanos Chaliasos. ZKP security tools and verification: Coverage, effectiveness, adoption, and challenges. CoRR, abs/2607.23752, 2026.
[20] Arman Kolozyan, Bram Vandenbogaerde, Janwillem Swalens, Lode Hoste, Stefanos Chaliasos, and Coen De Roover. Language-agnostic detection of computation-constraint inconsistencies in ZKP programs via value inference. In SP, pages 3091–3110. IEEE Computer Society, 2026.
[21] Vu Le, Mehrdad Afshari, and Zhendong Su. Compiler validation via equivalence modulo inputs. In PLDI, pages 216–226. ACM, 2014.
[22] Xavier Leroy. Formal verification of a realistic compiler. CACM, 52:107–115, 2009.
[23] Junrui Liu, Ian Kretz, Hanzhi Liu, Bryan Tan, Jonathan Wang, Yi Sun, Luke Pearson, Anders Miltner, Isil Dillig, and Yu Feng. Certifying zero-knowledge circuits with refinement types. In SP, pages 1741–1759. IEEE Computer Society, 2024.
[24] Alex Ozdemir, Riad S. Wahby, Fraser Brown, and Clark W. Barrett. Bounded verification for finite-field-blasting in a compiler for zero knowledge proofs. Formal Methods Syst. Des., 67:161–188, 2025.
[25] Shankara Pailoor, Yanju Chen, Franklyn Wang, Clara Rodríguez-Núñez, Jacob Van Geffen, Jason Morton,
Michael Chu, Brian Gu, Yu Feng, and Isil Dillig. Automated detection of under-constrained circuits in zero-knowledge proofs. PACMPL, 7:1510–1532, 2023.
[26] Fatemeh Heidari Soureshjani, Mathias Hall-Andersen, MohammadMahdi Jahanara, Jeffrey Kam, Jan Gorzny, and Mohsen Ahmadvand. Automated analysis of Halo2 circuits. In SMT, volume 3429 of CEUR, pages 3–17. CEUR-WS.org, 2023.
[27] Jon Stephens, Shankara Pailoor, and Isil Dillig. Automated verification of consistency in zero-knowledge proof circuits. In CAV, volume 15931 of LNCS, pages 315–338. Springer, 2025.
[28] Hideaki Takahashi, Jihwan Kim, Suman Jana, and Junfeng Yang. zkFuzz: Foundation and framework for effective fuzzing of zero-knowledge circuits. In SP, pages 3055–3074. IEEE Computer Society, 2026.
[29] Sebastian Watzinger, Valentin Wüstholz, Deepak Garg, and Maria Christakis. Cost-effective testing of MPC compilers. In FSE, pages 4529–4550. ACM, 2026.
[30] Hongbo Wen, Jon Stephens, Yanju Chen, Kostas Ferles, Shankara Pailoor, Kyle Charbonnet, Isil Dillig, and Yu Feng. Practical security analysis of zero-knowledge proof circuits. In Security. USENIX, 2024.
[31] Dongwei Xiao, Zhibo Liu, Yiteng Peng, and Shuai Wang. MTZK: Testing and exploring bugs in zero-knowledge (ZK) compilers. In NDSS. The Internet Society, 2025.
[32] Xuejun Yang, Yang Chen, Eric Eide, and John Regehr. Finding and understanding bugs in C compilers. In PLDI, pages 283–294. ACM, 2011.