Advisory

GHSA-4q83-7cq4-p6wg

Also known as: RUSTSEC-2023-0005

Summary

tokio::io::ReadHalf<T>::unsplit is Unsound

Details

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.

Severity

Low Basis: The source's own band: LOW

Dates

Published
2023-02-04 00:30 UTC
Modified
2026-09-10 03:49 UTC

Affected packages and fixes

tokio

crates.io · All systems

Affected

  • introduced 1.21.0, fixed 1.24.2 (semver)

Fixed versions

1.24.2

Fix

  • Fixed version 1.24.2
    cargo update -p tokio --precise 1.24.2

tokio

crates.io · All systems

Affected

  • introduced 1.19.0, fixed 1.20.4 (semver)

Fixed versions

1.20.4

Fix

  • Fixed version 1.20.4
    cargo update -p tokio --precise 1.20.4

tokio

crates.io · All systems

Affected

  • introduced 0.2.0, fixed 1.18.5 (semver)

Fixed versions

1.18.5

Fix

  • Fixed version 1.18.5
    cargo update -p tokio --precise 1.18.5

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences