GHSA-4q83-7cq4-p6wg
`tokio::io::ReadHalf<T>::unsplit` is Unsound
Blast Radius
tokio🦀tokio🦀tokioReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects crates.io packages — download data is not available via public APIs for these ecosystems.
Description
tokio::io::ReadHalf<T>::unsplit can violate the Pin contract
The soundness issue is described in the tokio/issues#5372
Specific set of conditions needed to trigger an issue (a !Unpin type in ReadHalf) is unusual, combined with the difficulty of making any arbitrary use-after-free exploitable in Rust without doing a lot of careful alignment of data types in the surrounding code.
The tokio feature io-util is also required to be enabled to trigger this
soundness issue.
Thanks to zachs18 reporting the issue to Tokio team responsibly and taiki-e and carllerche appropriately responding and fixing the soundness bug.
Tokio before 0.2.0 used futures 0.1 that did not have Pin, so it is not
affected by this issue.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🦀crates.io | tokio | ≥ 1.21.0&&< 1.24.2 | 1.24.2 |
| 🦀crates.io | tokio | ≥ 1.19.0&&< 1.20.4 | 1.20.4 |
| 🦀crates.io | tokio | ≥ 0.2.0&&< 1.18.5 | 1.18.5 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for tokio. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
Update tokio to 1.24.2 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-4q83-7cq4-p6wg is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether GHSA-4q83-7cq4-p6wg is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to GHSA-4q83-7cq4-p6wg. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-4q83-7cq4-p6wg in your dependencies?
O3 detects GHSA-4q83-7cq4-p6wg across crates.io dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.