GHSA-ghc8-5cgm-5rpf
medium
Inventory fails to prohibit standard library access prior to initialization of Rust standard library runtime
- Severity
- medium rating by GitHub
- Published
- Last changed
- Also known as
- RUSTSEC-2023-0057
Description
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| inventory (crates.io) | before 0.2.0, from 0.0.0-0 before 0.2.0 | GitHub Advisory Database, RustSec Advisory Database |
References
Sources
| Source | Record | Licence |
|---|---|---|
| GitHub Advisory Database | GHSA-ghc8-5cgm-5rpf changed 2024-02-10 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2023-0057 changed 2024-02-10 | CC0-1.0 |