# GHSA-c873-wfhp-wx5m: SP1 has missing verifier checks and fiat-shamir observations


- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Fix available:** Yes
- **Published:** 15 Jan 2025

## What is GHSA-c873-wfhp-wx5m?

GHSA-c873-wfhp-wx5m is a vulnerability in sp1-stark, published on 15 Jan 2025. 

### Official description

In SP1’s STARK verifier, the prover provided `chip_ordering` is used to fetch the index of the chips that have preprocessed columns. Prior to v4.0.0, the validation that this `chip_ordering` correctly provides these indexes was missing. In v4.0.0, this was fixed by adding a check that the indexed chip’s name is equal to the name stored in the verifying key’s chip information. 

In the recursive verifier, every verifier program is generated beforehand and later checked for correctness by requiring a merkle proof to the precomputed merkle root of valid verifier keys. Therefore, the recursive verifier and the on-chain verifier were not affected by this vulnerability. 

This code was audited twice, once as a part of the audit by KALOS and once by Cantina for v1.0.0. This bug was found by the Succinct team during preparation of v4.0.0. Out of abundance of caution, we will be deprecating all previous versions and freeze the corresponding verifiers.

Furthermore, in the recursive verifier, the `is_complete` boolean flag is used to flag a proof of complete execution. Prior to v4.0.0, this flag was underconstrained in parts of our recursive verifier, such as the first layer of the recursion. In v4.0.0, this bug was fixed by adding appropriate calls to the `assert_complete` function, which constrains the correctness of the `is_complete` flag. This code was a part of the audit for v3.0.0. This bug affects the soundness of the Rust SDK for verifying compressed proofs, and the soundness of on-chain verifier for deferred proofs. 

This issue was found by a combined effort from Aligned, LambdaClass and 3MI Labs, and was also independently found by Succinct during the preparation of v4.0.0. 

Lastly, SP1’s STARK verifier relied on logic inside Plonky3, one SP1's core dependencies, to check that the polynomial evaluation claims are correct using a FRI-based polynomial commitment scheme. To batch this check, multiple polynomial evaluation claims are combined using a random linear combination. Prior to v4.0.0, the individual evaluation claims were not observed into the challenger before sampling the coefficient for the random linear combination. In v4.0.0, this was fixed by observing all the evaluation claims into the challenger correctly inside of Plonky3.

This bug was found by Lev Soukhanov and Onur Kilic, and we have worked closely with the Plonky3 team to mitigate this vulnerability. We will be deprecating all previous versions and freezing their verifiers to ensure that versions with the vulnerability will not be used in production.

## Which versions are affected by GHSA-c873-wfhp-wx5m?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `sp1-stark` | crates.io | All versions | 4.0.0 |
| `sp1-stark` | crates.io | All versions | 4.0.0 |

## How do I fix GHSA-c873-wfhp-wx5m?

Upgrade sp1-stark to 4.0.0 or later.

## Is GHSA-c873-wfhp-wx5m being exploited?

There is no known exploitation of GHSA-c873-wfhp-wx5m in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-c873-wfhp-wx5m and fix it if it is affected.

What it is: GHSA-c873-wfhp-wx5m is a vulnerability in sp1-stark, published on 15 Jan 2025. 
Exploitation: There is no known exploitation of GHSA-c873-wfhp-wx5m in the wild and no public exploit code.

Affected packages and fixed versions:
- sp1-stark (crates.io): affected all versions; fixed in 4.0.0
- sp1-stark (crates.io): affected all versions; fixed in 4.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-c873-wfhp-wx5m/ (Markdown: https://insights.sbomify.com/GHSA-c873-wfhp-wx5m/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-c873-wfhp-wx5m

---
From sbomify Insights: https://insights.sbomify.com/GHSA-c873-wfhp-wx5m/
Summaries are generated and may contain mistakes; the official description above is the record.
