GHSA-ghc8-5cgm-5rpf
MEDIUMInventory fails to prohibit standard library access prior to initialization of Rust standard library runtime
Affected versions allow arbitrary caller-provided code to execute before the lifetime of main.
If the caller-provided code accesses particular pieces of the standard library that require an initialized Rust runtime, such as std::io or std::thread, these may not behave as documented. Panics are likely; UB is possible.
The flaw was corrected by enforcing that only code written within the inventory crate, which is guaranteed not to access runtime-dependent parts of the standard library, runs before main. Caller-provided code is restricted to running at compile time.
- Published
- 10 Sep 2023
- Last modified
- 10 Feb 2024
- Also known as
- RUSTSEC-2023-0057
- Sources
- OSVJSONOSV RUSTSEC-2023-0057JSON
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| OSV | crates.io | inventory | < 0.2.0 | 0.2.0 |
| OSV | crates.io | inventory | >= 0.0.0-0, < 0.2.0 | 0.2.0 |
References
- https://github.com/dtolnay/inventory/pull/43 · WEB
- https://github.com/dtolnay/inventory/commit/b853350a3800e38d2cb9950355b80bc8b8d3959c · WEB
- https://github.com/dtolnay/inventory · PACKAGE
- https://rustsec.org/advisories/RUSTSEC-2023-0057.html · WEB, ADVISORY
- https://crates.io/crates/inventory · PACKAGE
History
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 10 Sep 2023)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 11 Sep 2023)