GHSA-ghc8-5cgm-5rpf: Inventory fails to prohibit standard library access prior to initialization of Rust standard library runtime
N/A
CVSS Score
Basic Information
CVE ID
-
GHSA ID
EPSS Score
-
CWE
-
Published
9/11/2023
Updated
9/11/2023
KEV Status
No
Technology
Rust
Technical Details
CVSS Vector
-
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| inventory | rust | < 0.2.0 | 0.2.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stemmed from two key functions:
- inventory::submit - Public API entry point that accepted arbitrary user values through submit! macro expansions. These values were executed in #[ctor] initializers before main.
- Registry::submit - Internal method that processed dynamically allocated nodes, enabling runtime-linked list manipulation before standard library initialization.
The patch (b853350) addressed this by:
- Removing inventory::submit
- Requiring const construction via ErasedNode
- Replacing Box<Node<T>> with static Node using const expressions This restricted execution to compile-time only, preventing pre-main runtime code execution.