Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. inventory
  4. ›
  5. GHSA-ghc8-5cgm-5rpf

GHSA-ghc8-5cgm-5rpf: Inventory fails to prohibit standard library access prior to initialization of Rust standard library runtime

September 11, 2023

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.

References

  • github.com/advisories/GHSA-ghc8-5cgm-5rpf
  • github.com/dtolnay/inventory
  • github.com/dtolnay/inventory/commit/b853350a3800e38d2cb9950355b80bc8b8d3959c
  • github.com/dtolnay/inventory/pull/43
  • rustsec.org/advisories/RUSTSEC-2023-0057.html

Code Behaviors & Features

Detect and mitigate GHSA-ghc8-5cgm-5rpf with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 0.2.0

Fixed versions

  • 0.2.0

Solution

Upgrade to version 0.2.0 or above.

Source file

cargo/inventory/GHSA-ghc8-5cgm-5rpf.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:14:50 +0000.