Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. tokio
  4. ›
  5. GHSA-4q83-7cq4-p6wg

GHSA-4q83-7cq4-p6wg: `tokio::io::ReadHalf<T>::unsplit` is Unsound

February 4, 2023

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

  • github.com/advisories/GHSA-4q83-7cq4-p6wg
  • github.com/tokio-rs/tokio
  • github.com/tokio-rs/tokio/issues/5372
  • rustsec.org/advisories/RUSTSEC-2023-0005.html

Code Behaviors & Features

Detect and mitigate GHSA-4q83-7cq4-p6wg with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 0.2.0 before 1.18.5, all versions starting from 1.19.0 before 1.20.4, all versions starting from 1.21.0 before 1.24.2

Fixed versions

  • 1.24.2
  • 1.20.4
  • 1.18.5

Solution

Upgrade to versions 1.18.5, 1.20.4, 1.24.2 or above.

Source file

cargo/tokio/GHSA-4q83-7cq4-p6wg.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:14:45 +0000.