CVE-2021-45687
Description
An issue was discovered in the raw-cpuid crate before 9.1.1 for Rust. If the serialize feature is used (which is not the the default), a Deserialize operation may lack sufficient validation, leading to memory corruption or a panic.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
The raw-cpuid Rust crate before 9.1.1 with the 'serialize' feature has insufficient validation in Deserialize implementations, enabling memory corruption or panics.
Vulnerability
The raw-cpuid crate (versions >=3.2.0, <9.1.1) for Rust contains a vulnerability in the Deserialize implementations for most structs when the non-default serialize feature is enabled [2][4]. The serialization logic lacks sufficient input validation, allowing crafted deserialized data to break internal invariants [1][2]. This affects all releases from 3.2.0 up to but not including 9.1.1 [2][4].
Exploitation
An attacker must supply a malicious serialized payload to be deserialized by a component that uses the raw-cpuid crate with the serialize feature enabled [2][4]. The attacker does not require special privileges or user interaction beyond delivering the payload through a legitimate deserialization path [2]. Once deserialized, the invalid data triggers undefined behavior or assertion failures [2].
Impact
Successful exploitation can lead to undefined behavior (specifically in as_string() methods, which internally call std::str::from_utf8_unchecked()) or panics due to failed assertions, resulting in memory corruption or denial-of-service [2][4]. The attack affects safety guarantees in safe Rust code, potentially compromising process integrity [2].
Mitigation
The vulnerability is patched in raw-cpuid version 9.1.1 and later [2][4]. Users should update to at least 9.1.1. If an immediate update is not possible, the serialize feature can be disabled (it is not enabled by default) to avoid the vulnerable code path [1][2]. Versions 3.1.0 and earlier are unaffected by this specific issue [2][4].
AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
raw-cpuidcrates.io | >= 3.1.0, < 9.1.1 | 9.1.1 |
Affected products
2- raw-cpuid/raw-cpuiddescription
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
5- github.com/advisories/GHSA-w428-f65r-h4q2ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2021-45687ghsaADVISORY
- github.com/gz/rust-cpuid/issues/43ghsaWEB
- raw.githubusercontent.com/rustsec/advisory-db/main/crates/raw-cpuid/RUSTSEC-2021-0089.mdghsax_refsource_MISCWEB
- rustsec.org/advisories/RUSTSEC-2021-0089.htmlghsax_refsource_MISCWEB
News mentions
0No linked articles in our index yet.