# GHSA-rr8g-9fpq-6wmg: Tokio broadcast channel calls clone in parallel, but does not require `Sync`

> Unsoundness in Rust broadcast channels allows memory corruption when cloning non-Sync values, potentially leading to code execution.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Not stated
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 7 Apr 2025
- **Also known as:** RUSTSEC-2025-0023

## What is GHSA-rr8g-9fpq-6wmg?

GHSA-rr8g-9fpq-6wmg is a memory corruption vulnerability in tokio, published on 7 Apr 2025. 

### Official description

The broadcast channel internally calls `clone` on the stored value when receiving it, and only requires `T:Send`. This means that using the broadcast channel with values that are `Send` but not `Sync` can trigger unsoundness if the `clone` implementation makes use of the value being `!Sync`.

Thank you to Austin Bonander for finding and reporting this issue.

## Which versions are affected by GHSA-rr8g-9fpq-6wmg?

7 open source packages ship an affected version, including tokio.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `tokio` | crates.io | From 0.2.5 | 1.38.2, 1.42.1, 1.43.1, 1.44.2 |
| `tokio` | crates.io | From 0.2.5 | 1.38.2 |
| `tokio` | crates.io | From 0.2.5 | 1.38.2 |
| `tokio` | crates.io | From 1.39.0 | 1.43.1 |
| `tokio` | crates.io | From 1.39.0 | 1.43.1 |
| `tokio` | crates.io | From 1.44.0 | 1.44.2 |
| `tokio` | crates.io | From 1.44.0 | 1.44.2 |

## How do I fix GHSA-rr8g-9fpq-6wmg?

Upgrade tokio to a fixed version for your release line: 1.38.2, 1.42.1, 1.43.1 or 1.44.2.

## Is GHSA-rr8g-9fpq-6wmg being exploited?

There is no known exploitation of GHSA-rr8g-9fpq-6wmg in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-rr8g-9fpq-6wmg and fix it if it is affected.

What it is: GHSA-rr8g-9fpq-6wmg is a memory corruption vulnerability in tokio, published on 7 Apr 2025. 
Exploitation: There is no known exploitation of GHSA-rr8g-9fpq-6wmg in the wild and no public exploit code.

Affected packages and fixed versions:
- tokio (crates.io): affected from 0.2.5; fixed in 1.38.2, 1.42.1, 1.43.1, 1.44.2
- tokio (crates.io): affected from 0.2.5; fixed in 1.38.2
- tokio (crates.io): affected from 0.2.5; fixed in 1.38.2
- tokio (crates.io): affected from 1.39.0; fixed in 1.43.1
- tokio (crates.io): affected from 1.39.0; fixed in 1.43.1
- tokio (crates.io): affected from 1.44.0; fixed in 1.44.2
- tokio (crates.io): affected from 1.44.0; fixed in 1.44.2

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-rr8g-9fpq-6wmg/ (Markdown: https://insights.sbomify.com/GHSA-rr8g-9fpq-6wmg/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-rr8g-9fpq-6wmg

---
From sbomify Insights: https://insights.sbomify.com/GHSA-rr8g-9fpq-6wmg/
Summaries are generated and may contain mistakes; the official description above is the record.
