GHSA-ghc8-5cgm-5rpf json
Inventory fails to prohibit standard library access prior to initialization of Rust standard library runtime
published 3y ago modified 2y ago also RUSTSEC-2023-0057
- cvss
- —
- not scored
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- —
- no score, EPSS covers CVEs only
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- crates.io inventory 0.2.0
- github.com/dtolnay/inventory@b853350 commit
- github.com/dtolnay/inventory#43 pull request
Is GHSA-ghc8-5cgm-5rpf in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.
Check with FencerAffected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| crates.io | inventory | <0.2.0 >=0.0.0-0, <0.2.0 |
0.2.0 |
References
Sources
- GitHub Advisory GHSA-ghc8-5cgm-5rpf
- OSV RUSTSEC-2023-0057
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.