Vulnerability MediumRUSTSEC-2021-0089 · raw-cpuid
RUSTSEC-2021-0089: Optional `Deserialize` implementations lacking validation
Short answerA security vulnerability in the raw-cpuid crate: Optional `Deserialize` implementations lacking validation. GitHub rates it Medium. Fixed in 9.1.1: update to a fixed version.
| Crate | raw-cpuid |
|---|---|
| Type | Vulnerability (memory-corruption, denial-of-service) |
| Affected versions | From 3.1.1 before 9.1.1. |
| Fixed in | 9.1.1 |
| Severity | Medium (GitHub rating) |
| Published | 2021-01-20 |
| Last changed | 2023-11-08 |
| Also known as | CVE-2021-45687, GHSA-jf5h-cf95-w759, GHSA-w428-f65r-h4q2 |
What to do
- See which version you have:
cargo tree -i raw-cpuid(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p raw-cpuid. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for exampleraw-cpuid = "9.1.1") or update the dependency that pulls it in. - Check again with
cargo audit, or paste your Cargo.lock into our Cargo.toml checker.
Details from the advisory
When activating the non-default feature serialize, most structs implement serde::Deserialize without sufficient validation. This allows breaking invariants in safe code, leading to:
- Undefined behavior in
as_string()methods (which usestd::str::from_utf8_unchecked()internally). - Panics due to failed assertions.
See https://github.com/gz/rust-cpuid/issues/43.
References
- Package: crates.io/crates/raw-cpuid
- Advisory: rustsec.org/advisories/RUSTSEC-2021-0089.html
- Report: github.com/gz/rust-cpuid/issues/43
From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.
Other advisories for raw-cpuid
Up next
Same crateraw-cpuid: security historyEvery advisory for this crate, and whether it is safe to use today.Read it next →Did this answer your question?