Skip to content

GHSA-4q83-7cq4-p6wg RUSTSEC-2023-0005

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

Low crates.io
Severity
Low
The publisher's own rating, not a CVSS score
Exploit chance (EPSS)
—
No score published
Known exploited
No
Not in CISA's catalog
Weakness
—
Not classified
Fix
1.24.2
Upgrade tokio to this version or later

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 versions

crates.io

PackageVulnerableFixed in
tokio
>= 1.21.0, < 1.24.2
1.24.2
tokio
>= 1.19.0, < 1.20.4
1.20.4
tokio
>= 0.2.0, < 1.18.5
1.18.5
tokio
>= 0.2.0, < 1.18.5
>= 1.19.0, < 1.20.4
>= 1.21.0, < 1.24.2
1.18.5
1.20.4
1.24.2

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

tokio crates.io → 1.24.2

cargo
cargo update -p tokio --precise 1.24.2

References

Timeline

  1. Published
  2. Last updated by the source
AdvisorySeverityWhy it's related
GHSA-5wjr-9356-4wc8
Tokio: Race condition in `tokio::time::Interval`
Medium Also affects tokio
RUSTSEC-2026-0386
`AsyncFd::new` and related constructors violate I/O safety
Not rated yet Also affects tokio
GHSA-rr8g-9fpq-6wmg
Tokio broadcast channel calls clone in parallel, but does not require `Sync`
Low Also affects tokio
GHSA-7rrj-xr53-82p7
Tokio reject_remote_clients configuration may get dropped when creating a Windows named pipe
Medium Also affects tokio
RUSTSEC-2021-0124
Race Condition in tokio
High Also affects tokio
RUSTSEC-2021-0072
Race condition in tokio
Medium Also affects tokio
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor