# GHSA-8m24-3cfx-9fjw: sp1 has insufficient observation of cumulative sum


- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Fix available:** Yes
- **Published:** 8 Nov 2024

## What is GHSA-8m24-3cfx-9fjw?

GHSA-8m24-3cfx-9fjw is a vulnerability in sp1-recursion-circuit, published on 8 Nov 2024. 

### Official description

During proof generation, the prover must observe all values sent to the verifier to generate valid Fiat-Shamir challenges. Prior to v3.0.0 the cumulative sum of the permutation argument was not observed when sampling zeta, which is a random challenge sampled to force the constraints to be true. In v3.0.0, this is fixed by observing the cumulative sum into the challenger, which can is done by observing the commit to the entire permutation trace.

While this vulnerability is theoretically present in v2.0.0 and below, exploiting it is quite a difficult task as the cumulative sum one can get from manipulation is essentially random. It requires practically infeasible amount of computation and deep knowledge of cryptographic attacks to carry out.

This issue was discovered during the audit of SP1 V3.0.0 and was officially fixed on October 17th. Out of abundance of caution, we will be deprecating all versions of SP1 before 3.0.0.

## Which versions are affected by GHSA-8m24-3cfx-9fjw?

2 open source packages ship an affected version, including sp1-recursion-circuit.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `sp1-recursion-circuit` | crates.io | All versions | 3.0.0 |
| `sp1-recursion-circuit` | crates.io | All versions | 3.0.0 |

## How do I fix GHSA-8m24-3cfx-9fjw?

Upgrade sp1-recursion-circuit to 3.0.0 or later.

## Is GHSA-8m24-3cfx-9fjw being exploited?

There is no known exploitation of GHSA-8m24-3cfx-9fjw in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-8m24-3cfx-9fjw and fix it if it is affected.

What it is: GHSA-8m24-3cfx-9fjw is a vulnerability in sp1-recursion-circuit, published on 8 Nov 2024. 
Exploitation: There is no known exploitation of GHSA-8m24-3cfx-9fjw in the wild and no public exploit code.

Affected packages and fixed versions:
- sp1-recursion-circuit (crates.io): affected all versions; fixed in 3.0.0
- sp1-recursion-circuit (crates.io): affected all versions; fixed in 3.0.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-8m24-3cfx-9fjw/ (Markdown: https://insights.sbomify.com/GHSA-8m24-3cfx-9fjw/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-8m24-3cfx-9fjw

---
From sbomify Insights: https://insights.sbomify.com/GHSA-8m24-3cfx-9fjw/
Summaries are generated and may contain mistakes; the official description above is the record.
