# CVE-2025-61588: risc0 vulnerable to arbitrary code execution in guest via memory safety failure in `sys_read`

> A memory safety failure in sys_read allows the host to write to arbitrary guest memory, enabling arbitrary code execution within the zkVM guest.

- **Severity:** Critical 9.3 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 1 Oct 2025
- **Updated:** 2 Oct 2025
- **Also known as:** GHSA-jqq4-c7wq-36h7

## What is CVE-2025-61588?

CVE-2025-61588 is a critical memory corruption vulnerability in risc0, published on 1 Oct 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

RISC Zero is a zero-knowledge verifiable general computing platform based on zk-STARKs and the RISC-V microarchitecture. In versions 2.0.2 and below of risc0-zkvm-platform, when the zkVM guest calls sys_read, the host is able to use a crafted response to write to an arbitrary memory location in the guest. This capability can be leveraged to execute arbitrary code within the guest. As sys_read is the mechanism by which input is requested by the guest, all guest programs built with the affected versions are vulnerable. This critically compromises the soundness guarantees of the guest program. Other affected packages include risc0-aggregation versions below 0.9,  risc0-zkos-v1compat below 2.1.0, risc0-zkvm versions between 3.0.0-rc.1 and 3.0.1. This issue has been fixed in the following versions: risc0-zkvm-platform 2.1.0, risc0-zkos-v1compat 2.1.0, risc0-aggregation 0.9, and risc0-zkvm 2.3.2 and 3.0.3.

Weakness: CWE-94 (Improper Control of Generation of Code)

## Which versions are affected by CVE-2025-61588?

10 open source packages ship an affected version, including risc0-zkvm, risc0-aggregation and risc0-zkos-v1compat.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `risc0-zkvm` | crates.io | All versions | 2.3.2 |
| `risc0-zkvm` | crates.io | All versions | 2.3.2 |
| `risc0-zkvm` | crates.io | From 3.0.0 | 3.0.3 |
| `risc0-zkvm` | crates.io | From 3.0.0 | 3.0.3 |
| `risc0-aggregation` | crates.io | All versions | 0.9 |
| `risc0-aggregation` | crates.io | All versions | 0.9 |
| `risc0-zkos-v1compat` | crates.io | All versions | 2.1.0 |
| `risc0-zkos-v1compat` | crates.io | All versions | 2.1.0 |
| `risc0-zkvm-platform` | crates.io | All versions | 2.1.0 |
| `risc0-zkvm-platform` | crates.io | All versions | 2.1.0 |

## How do I fix CVE-2025-61588?

Upgrade risc0-zkvm to a fixed version for your release line: 2.3.2 or 3.0.3.

## Is CVE-2025-61588 being exploited?

There is no known exploitation of CVE-2025-61588 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-61588 and fix it if it is affected.

What it is: CVE-2025-61588 is a critical memory corruption vulnerability in risc0, published on 1 Oct 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2025-61588 in the wild and no public exploit code.

Affected packages and fixed versions:
- risc0-zkvm (crates.io): affected all versions; fixed in 2.3.2
- risc0-zkvm (crates.io): affected all versions; fixed in 2.3.2
- risc0-zkvm (crates.io): affected from 3.0.0; fixed in 3.0.3
- risc0-zkvm (crates.io): affected from 3.0.0; fixed in 3.0.3
- risc0-aggregation (crates.io): affected all versions; fixed in 0.9
- risc0-aggregation (crates.io): affected all versions; fixed in 0.9
- risc0-zkos-v1compat (crates.io): affected all versions; fixed in 2.1.0
- risc0-zkos-v1compat (crates.io): affected all versions; fixed in 2.1.0
- risc0-zkvm-platform (crates.io): affected all versions; fixed in 2.1.0
- risc0-zkvm-platform (crates.io): affected all versions; fixed in 2.1.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/CVE-2025-61588/ (Markdown: https://insights.sbomify.com/CVE-2025-61588/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-61588
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-61588
- OSV: https://osv.dev/vulnerability/CVE-2025-61588

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-61588/
Summaries are generated and may contain mistakes; the official description above is the record.
