Email me

Rust advisories / tokio

Unsound LowRUSTSEC-2023-0005 · tokio

RUSTSEC-2023-0005: `tokio::io::ReadHalf<T>::unsplit` is Unsound

Short answertokio has an API that can cause undefined behaviour from safe code: `tokio::io::ReadHalf<T>::unsplit` is Unsound. Fixed in 1.18.5, 1.20.4, 1.24.2.

Cratetokio
TypeUnsound (memory-exposure)
Affected versionsFrom 0.2.0 before 1.18.5; from 1.19.0 before 1.20.4; from 1.21.0 before 1.24.2.
Fixed in1.18.5, 1.20.4, 1.24.2
SeverityLow (GitHub rating)
Published2023-01-11
Last changed2023-11-08
Also known asGHSA-4q83-7cq4-p6wg

What to do

  1. See which version you have: cargo tree -i tokio (it also shows which of your dependencies pulls it in).
  2. Update within your version requirement: cargo update -p tokio. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for example tokio = "1.24.2") or update the dependency that pulls it in.
  3. Check again with cargo audit, or paste your Cargo.lock into our Cargo.toml checker.

Details from the advisory

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.

References

From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.

Other advisories for tokio

Full security history of tokio

Up next

Same cratetokio: security historyEvery advisory for this crate, and whether it is safe to use today.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ