CVE-2026-40323: Sp1 sdk SP1 V6 Recursion Circuit Row-Count Vulnerability

HIGH
Advisory Identifier: GHSA-63x8-x938-vx33
CWE-345 CWE-354
Published
Advisory Summary

CVE-2026-40323 is a HIGH sp1 v6 recursion circuit row-count vulnerability (CWE-345: Insufficient Verification of Data Authenticity) affecting Sp1 sdk libraries in the crates.io ecosystem. The issue involves sp1 v6 recursion circuit row-count binding gap. Remediation is available by upgrading affected packages to version 6.1.0.

CVE-2026-40323 at a Glance

CVE Identifier CVE-2026-40323
GHSA Identifier GHSA-63x8-x938-vx33
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-345: Insufficient Verification of Data Authenticity
Affected Product Sp1 sdk
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix CVE-2026-40323

To remediate this vulnerability, upgrade all affected Sp1 sdk dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

sp1_sdk fixed: 6.1.0
Upgrade sp1_sdk to 6.1.0
sp1_recursion_circuit fixed: 6.1.0
Upgrade sp1_recursion_circuit to 6.1.0
sp1_prover fixed: 6.1.0
Upgrade sp1_prover to 6.1.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for sp1_sdk

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-40323, inspect your project dependencies for Sp1 sdk:

inspect dependencies for sp1_sdk

Analyze the terminal output to locate any version of Sp1 sdk in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.1.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-345: Insufficient Verification of Data Authenticity, where the product does not sufficiently verify the origin or authenticity of data, in a way that causes it to accept invalid data. In Sp1 sdk, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary 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.

CVE-2026-40323 Affected Sp1 sdk Versions

3 component(s)
Fixed Versions:
6.1.0
Product / Package Ecosystem Affected Versions Fixed Version
sp1_sdk
crates.io
≥ 6.0.0
< 6.1.0
6.1.0
sp1_recursion_circuit
crates.io
≥ 6.0.0
< 6.1.0
6.1.0
sp1_prover
crates.io
≥ 6.0.0
< 6.1.0
6.1.0

References

Frequently Asked Questions

What is CVE-2026-40323?
CVE-2026-40323 is a security vulnerability in Sp1 sdk involving SP1 V6 Recursion Circuit Row-Count Binding Gap under CWE-345: Insufficient Verification of Data Authenticity.
Which Sp1 sdk versions are affected?
Affected versions include releases prior to 6.1.0 across affected packages: sp1_sdk, sp1_recursion_circuit, sp1_prover.
What version fixes CVE-2026-40323?
Upgrading to 6.1.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is sp1_sdk affected?
Yes, sp1_sdk is affected in releases prior to 6.1.0. Upgrade your dependency to 6.1.0 or later.
Is sp1_recursion_circuit affected?
Yes, sp1_recursion_circuit is affected in releases prior to 6.1.0. Upgrade your dependency to 6.1.0 or later.
What CWE is associated with CVE-2026-40323?
CVE-2026-40323 is classified under CWE-345: Insufficient Verification of Data Authenticity (The product does not sufficiently verify the origin or authenticity of data, in a way that causes it to accept invalid data.).
How can I check crates.io dependencies for CVE-2026-40323?
Run the dependency tree command: 'inspect dependencies for sp1_sdk'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-63x8-x938-vx33",
  "modified" : "2026-04-24T20:50:48Z",
  "published" : "2026-04-14T00:05:19Z",
  "aliases" : [ "CVE-2026-40323" ],
  "summary" : "SP1 V6 Recursion Circuit Row-Count Binding Gap",
  "details" : "## Summary\n\nA 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.\n\n- **Affected versions:** `>= 6.0.0, <= 6.0.2`\n- **Not affected:** SP1 V5 (all versions)\n- **Severity:** High\n\n## Details\n\n### Background\n\nThe 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.\n\n### The Bug\n\nIn 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.\n\nThe 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.\n\n### Potential Impact\n\nThe 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.\n\nWhile 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.\n\n### Why the Native Verifier Is Not Affected\n\nThe 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.\n\n## Mitigation\n\nThe 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.\n\nThis forces both witnesses to describe the same trace geometry. Any divergence is now a constraint failure.\n\n## Credit\n\nThis vulnerability was identified through the SP1 bug bounty program on Code4rena.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:H/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "sp1_sdk"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.0.0"
      }, {
        "fixed" : "6.1.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 6.0.2"
    }
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "sp1_recursion_circuit"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.0.0"
      }, {
        "fixed" : "6.1.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 6.0.2"
    }
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "sp1_prover"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.0.0"
      }, {
        "fixed" : "6.1.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 6.0.2"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/succinctlabs/sp1/security/advisories/GHSA-63x8-x938-vx33"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-40323"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/succinctlabs/sp1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/succinctlabs/sp1/releases/tag/v6.1.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-345", "CWE-354" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-14T00:05:19Z",
    "nvd_published_at" : "2026-04-18T00:16:36Z"
  }
}