7.5high
Mio's tokens for named pipes may be delivered after deregistration
- Severity
- 7.5high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.88% (higher than 60% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-r8w9-5wcg-vfj7RUSTSEC-2024-0019
Description
Mio is a Metal I/O library for Rust. When using named pipes on Windows, mio will under some circumstances return invalid tokens that correspond to named pipes that have already been deregistered from the mio registry. The impact of this vulnerability depends on how mio is used. For some applications, invalid tokens may be ignored or cause a warning or a crash. On the other hand, for applications that store pointers in the tokens, this vulnerability may result in a use-after-free. For users of Tokio, this vulnerability is serious and can result in a use-after-free in Tokio. The vulnerability is Windows-specific, and can only happen if you are using named pipes. Other IO resources are not affected. This vulnerability has been fixed in mio v0.8.11. All versions of mio between v0.7.2 and v0.8.10 are vulnerable. Tokio is vulnerable when you are using a vulnerable version of mio AND you are using at least Tokio v1.30.0. Versions of Tokio prior to v1.30.0 will ignore invalid tokens, so they are not vulnerable. Vulnerable libraries that use mio can work around this issue by detecting and ignoring invalid tokens.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| tokio-rs mio | >= 0.7.2, < 0.8.11 | CVE List |
| mio_project mio | from 0.7.2 before 0.8.11, from 0.7.2 up to 0.8.10 | CVE List, NVD |
| mio (crates.io) | from 0.7.2 before 0.8.11 | GitHub Advisory Database, RustSec Advisory Database |
| tokio tokio | from 1.30.0 | NVD |
All scores
| GitHub_M | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
| GitHub | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
| NVD | 9.1critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H |
Classification
What each source says
CVE List
Mio is a Metal I/O library for Rust. When using named pipes on Windows, mio will under some circumstances return invalid tokens that correspond to named pipes that have already been deregistered from the mio registry. The impact of this vulnerability depends on how mio is used. For some applications, invalid tokens may be ignored or cause a warning or a crash. On the other hand, for applications that store pointers in the tokens, this vulnerability may result in a use-after-free. For users of Tokio, this vulnerability is serious and can result in a use-after-free in Tokio. The vulnerability is Windows-specific, and can only happen if you are using named pipes. Other IO resources are not affected. This vulnerability has been fixed in mio v0.8.11. All versions of mio between v0.7.2 and v0.8.10 are vulnerable. Tokio is vulnerable when you are using a vulnerable version of mio AND you are using at least Tokio v1.30.0. Versions of Tokio prior to v1.30.0 will ignore invalid tokens, so they are not vulnerable. Vulnerable libraries that use mio can work around this issue by detecting and ignoring invalid tokens.
GitHub Advisory Database
Impact
When using named pipes on Windows, mio will under some circumstances return invalid tokens that correspond to named pipes that have already been deregistered from the mio registry. The impact of this vulnerability depends on how mio is used. For some applications, invalid tokens may be ignored or cause a warning or a crash. On the other hand, for applications that store pointers in the tokens, this vulnerability may result in a use-after-free.
For users of Tokio, this vulnerability is serious and can result in a use-after-free in Tokio.
The vulnerability is Windows-specific, and can only happen if you are using named pipes. Other IO resources are not affected.
Affected versions
This vulnerability has been fixed in mio v0.8.11.
All versions of mio between v0.7.2 and v0.8.10 are vulnerable.
Tokio is vulnerable when you are using a vulnerable version of mio AND you are using at least Tokio v1.30.0. Versions of Tokio prior to v1.30.0 will ignore invalid tokens, so they are not vulnerable.
Workarounds
Vulnerable libraries that use mio can work around this issue by detecting and ignoring invalid tokens.
Technical details
When an IO resource registered with mio has a readiness event, mio delivers that readiness event to the user using a user-specified token. Mio guarantees that when an IO resource is deregistered, then it will never return the token for that IO resource again. However, for named pipes on windows, mio may sometimes deliver the token for a named pipe even though the named pipe has been previously deregistered.
This vulnerability was originally reported in the Tokio issue tracker: tokio-rs/tokio#6369 This vulnerability was fixed in: tokio-rs/mio#1760 This vulnerability is also known as RUSTSEC-2024-0019.
Thank you to @rofoun and @radekvit for discovering and reporting this issue.
RustSec Advisory Database
Impact
When using named pipes on Windows, mio will under some circumstances return invalid tokens that correspond to named pipes that have already been deregistered from the mio registry. The impact of this vulnerability depends on how mio is used. For some applications, invalid tokens may be ignored or cause a warning or a crash. On the other hand, for applications that store pointers in the tokens, this vulnerability may result in a use-after-free.
For users of Tokio, this vulnerability is serious and can result in a use-after-free in Tokio.
The vulnerability is Windows-specific, and can only happen if you are using named pipes. Other IO resources are not affected.
Affected versions
This vulnerability has been fixed in mio v0.8.11.
All versions of mio between v0.7.2 and v0.8.10 are vulnerable.
Tokio is vulnerable when you are using a vulnerable version of mio AND you are using at least Tokio v1.30.0. Versions of Tokio prior to v1.30.0 will ignore invalid tokens, so they are not vulnerable.
Workarounds
Vulnerable libraries that use mio can work around this issue by detecting and ignoring invalid tokens.
Technical details
When an IO resource registered with mio has a readiness event, mio delivers that readiness event to the user using a user-specified token. Mio guarantees that when an IO resource is deregistered, then it will never return the token for that IO resource again. However, for named pipes on windows, mio may sometimes deliver the token for a named pipe even though the named pipe has been previously deregistered.
This vulnerability was originally reported in the Tokio issue tracker: tokio-rs/tokio#6369
This vulnerability was fixed in: tokio-rs/mio#1760
Thank you to @rofoun and @radekvit for discovering and reporting this issue.
NVD (es)
Mio es una librería Metal I/O para Rust. Cuando se utilizan canalizaciones con nombre en Windows, mio, en algunas circunstancias, devolverá tokens no válidos que corresponden a canalizaciones con nombre que ya se han dado de baja del registro de mio. El impacto de esta vulnerabilidad depende de cómo se utilice mio. Para algunas aplicaciones, los tokens no válidos pueden ignorarse o provocar una advertencia o un bloqueo. Por otro lado, para las aplicaciones que almacenan punteros en tokens, esta vulnerabilidad puede resultar en un use-after-free para los usuarios de Tokio, esta vulnerabilidad es grave y puede resultar en un use-after-free en Tokio. La vulnerabilidad es específica de Windows y solo puede ocurrir si utiliza canalizaciones con nombre. Otros recursos de IO no se ven afectados. Esta vulnerabilidad se ha solucionado en mio v0.8.11. Todas las versiones de mio entre v0.7.2 y v0.8.10 son vulnerables. Tokio es vulnerable cuando estás usando una versión vulnerable de mio Y estás usando al menos Tokio v1.30.0. Las versiones de Tokio anteriores a la v1.30.0 ignorarán los tokens no válidos, por lo que no son vulnerables. Las bibliotecas vulnerables que utilizan mio pueden solucionar este problema detectando e ignorando tokens no válidos.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-27308 changed 2024-08-27 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-r8w9-5wcg-vfj7 changed 2026-09-10 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2024-0019 changed 2026-10-12 | CC0-1.0 |
| NVD | CVE-2024-27308 changed 2026-06-17 | Public domain |