{"id":"GHSA-ghc8-5cgm-5rpf","aliases":["GHSA-ghc8-5cgm-5rpf","RUSTSEC-2023-0057"],"related":[],"kind":"vulnerability","state":"published","title":"Inventory fails to prohibit standard library access prior to initialization of Rust standard library runtime","summary":"Affected versions allow arbitrary caller-provided code to execute before the lifetime of `main`.\n\nIf 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.\n\nThe 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.","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"Affected versions allow arbitrary caller-provided code to execute before the lifetime of `main`.\n\nIf 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.\n\nThe 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.","format":"markdown","source":"ghsa"}],"published":"2023-09-10T12:00:00.000Z","modified":"2024-02-10T16:26:48.633Z","severity":{"scorer":"GitHub","scheme":"rating","rating":"MEDIUM"},"severities":[{"scorer":"GitHub","scheme":"rating","rating":"MEDIUM"}],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.2.0"}],"ecosystem":"crates.io","package":"inventory","purl":"pkg:cargo/inventory","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.2.0"}],"ecosystem":"crates.io","package":"inventory","purl":"pkg:cargo/inventory","source":"rustsec"}],"references":[{"url":"https://github.com/dtolnay/inventory/pull/43","tags":["web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/dtolnay/inventory/commit/b853350a3800e38d2cb9950355b80bc8b8d3959c","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/dtolnay/inventory","tags":["package"],"sources":["ghsa"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2023-0057.html","tags":["advisory","web"],"sources":["ghsa","rustsec"]},{"url":"https://crates.io/crates/inventory","tags":["package"],"sources":["rustsec"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-ghc8-5cgm-5rpf","url":"https://github.com/advisories/GHSA-ghc8-5cgm-5rpf","licence":"CC-BY-4.0","modified":"2024-02-10T16:26:48.633Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2023-0057","url":"https://rustsec.org/advisories/RUSTSEC-2023-0057.html","licence":"CC0-1.0","modified":"2024-02-10T16:26:48.633Z"}],"updatedAt":"2026-11-25T22:56:43.154Z"}