Summary
SP1 V6 Recursion Circuit Row-Count Binding Gap
A soundness vulnerability in the SP1 V6 recursive shard verifier allows a malicious prover to construct a recursive proof from a shard proof that the native verifier would reject.
- Affected versions:
>= 6.0.0, <= 6.0.2 - Not affected: SP1 V5 (all versions)
- Severity: High
Details
Background
The recursive shard verifier circuit verifies shard proofs inside a recursive proof. Each shard proof includes a jagged PCS opening, which binds trace-shape metadata into a modified commitment and uses that same shape to evaluate the committed polynomials. These two operations must agree on the committed table heights.
The Bug
In the V6 recursion circuit's jagged verifier, the two checks above are served by separate witnesses: a vector of row counts hashed into the modified commitment (commitment side), and a separate witness of prefix sums derived from row and column counts that drives the jagged polynomial evaluator (evaluation side). The prefix sums are observed within the shard verifier.
The consistency check between these two witnesses was missing in the recursion sub-circuit describing the jagged PCS verifier. A malicious prover can therefore supply one trace shape for commitment binding and a different shape for polynomial evaluation.
Potential Impact
The vulnerability applies to both main trace and preprocessed trace metadata. Because preprocessed traces encode circuit structure (selectors, fixed columns, permutation layout), the potential impact extends beyond data forgery to misrepresentation of the circuit itself.
While a demonstration of a full exploit proving arbitrary statements has not been created, since modifying one table's layout incidentally constrains changes to related tables, this barrier is not by design and should not be relied upon. This is considered a soundness violation that is unacceptable regardless of current exploitability.
Why the Native Verifier Is Not Affected
The native shard verifier uses a single jagged PCS verifier object where row counts and evaluation layout are derived from the same data, so the split-witness divergence cannot occur. The recursion circuit's shard-level checks (prefix-sum and total-area assertions) only constrain the evaluation-side parameters, not the commitment-side row counts, so they do not catch the gap.
Mitigation
The fix adds a post-evaluation consistency constraint in the recursive jagged verifier. After the jagged evaluation returns the prefix-sum values derived from the evaluation layout, the circuit reconstructs expected prefix sums from the commitment-side row counts (repeating each row count by its corresponding column count and accumulating). It then asserts element-wise equality between the reconstructed and returned prefix sums, and verifies that the final accumulated area matches the total area from the evaluation parameters.
This forces both witnesses to describe the same trace geometry. Any divergence is now a constraint failure.
Credit
This vulnerability was identified through the SP1 bug bounty program on Code4rena.
Impact
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
sp1_sdk to 6.1.0 or later; sp1_recursion_circuit to 6.1.0 or later; sp1_prover to 6.1.0 or later
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2026-40323? CVE-2026-40323 is a high-severity security vulnerability in sp1_sdk (rust), affecting versions >= 6.0.0, <= 6.0.2. It is fixed in 6.1.0.
- Which packages are affected by CVE-2026-40323?
sp1_sdk(rust) (versions >= 6.0.0, <= 6.0.2)sp1_recursion_circuit(rust) (versions >= 6.0.0, <= 6.0.2)sp1_prover(rust) (versions >= 6.0.0, <= 6.0.2)
- Is there a fix for CVE-2026-40323? Yes. CVE-2026-40323 is fixed in 6.1.0. Upgrade to this version or later.
- Is CVE-2026-40323 exploitable, and should I be worried? Whether CVE-2026-40323 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-40323 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-40323?
- Upgrade
sp1_sdkto 6.1.0 or later - Upgrade
sp1_recursion_circuitto 6.1.0 or later - Upgrade
sp1_proverto 6.1.0 or later
- Upgrade