# GHSA-7mcq-f592-pf7v: Slice Ring Buffer and Slice Deque contains four unique double-free vulnerabilities triggered through safe APIs

> Four double-free vulnerabilities in slice-ring-buffer allow attackers to trigger memory corruption and potential code execution via safe APIs.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Not stated
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 16 Jun 2025
- **Also known as:** RUSTSEC-2025-0044

## What is GHSA-7mcq-f592-pf7v?

GHSA-7mcq-f592-pf7v is an use after free vulnerability in slice-deque, published on 16 Jun 2025. 

### Official description

The crate [`slice-ring-buffer`](https://crates.io/crates/slice-ring-buffer) was developed as a fork of [`slice-deque`](https://crates.io/crates/slice-deque) to continue maintenance and provide security patches, since the latter has been officially unmaintained ([RUSTSEC-2020-0158](https://rustsec.org/advisories/RUSTSEC-2020-0158.html)).

While `slice-ring-buffer` has addressed some previously reported memory safety issues inherited from its fork origin ([RUSTSEC-2021-0047](https://rustsec.org/advisories/RUSTSEC-2021-0047.html)), it still retains multiple unresolved memory corruption vulnerabilities.

Specifically, we have discovered four new memory safety bugs, each resulting in double-free violations that can occur when only safe APIs are invoked. These vulnerabilities correspond to four distinct safe APIs in the crate, each exposing unsound and vulnerable behavior due to incorrect usage of unsafe code internally.

Unfortunately, the maintainer doesn't have much availability to resolve these issues so there's no concrete timeline for fixes. Community contributions towards fixing these vulnerabilities would be much appreciated.

## Which versions are affected by GHSA-7mcq-f592-pf7v?

5 open source packages ship an affected version, including slice-deque and slice-ring-buffer.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `slice-deque` | crates.io | All versions to 0.3.0 | None |
| `slice-deque` | crates.io | All versions to 0.3.0 | None |
| `slice-ring-buffer` | crates.io | All versions to 0.3.4 | None |
| `slice-ring-buffer` | crates.io | All versions to 0.3.4 | None |
| `slice-ring-buffer` | crates.io | From 0.0.0-0 | None |

## How do I fix GHSA-7mcq-f592-pf7v?

No fix has been published for GHSA-7mcq-f592-pf7v yet. Limit exposure of the affected software until one is available.

## Is GHSA-7mcq-f592-pf7v being exploited?

There is no known exploitation of GHSA-7mcq-f592-pf7v in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-7mcq-f592-pf7v and fix it if it is affected.

What it is: GHSA-7mcq-f592-pf7v is an use after free vulnerability in slice-deque, published on 16 Jun 2025. 
Exploitation: There is no known exploitation of GHSA-7mcq-f592-pf7v in the wild and no public exploit code.

Affected packages and fixed versions:
- slice-deque (crates.io): affected all versions up to 0.3.0; no fix listed
- slice-deque (crates.io): affected all versions up to 0.3.0; no fix listed
- slice-ring-buffer (crates.io): affected all versions up to 0.3.4; no fix listed
- slice-ring-buffer (crates.io): affected all versions up to 0.3.4; no fix listed
- slice-ring-buffer (crates.io): affected from 0.0.0-0; no fix listed

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-7mcq-f592-pf7v/ (Markdown: https://insights.sbomify.com/GHSA-7mcq-f592-pf7v/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-7mcq-f592-pf7v

---
From sbomify Insights: https://insights.sbomify.com/GHSA-7mcq-f592-pf7v/
Summaries are generated and may contain mistakes; the official description above is the record.
