Every CVE Search/ Get API key

CVE-2021-45687

Optional `Deserialize` implementations lacking validation

9.8 CriticalFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
High
Integrity
High
Availability
High

Exploit likelihood

1.16%Up 0.6 points since Dec 27, 2021
90%50%10%1%

What each source reports

NVD Score used 9.8

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.

Record
CVE-2021-45687
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS 2.0
6.8 MediumAV:N/AC:M/Au:N/C:P/I:P/A:P
Weakness
CWE-20
Updated
2026-11-02
CVE List No score

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.

Record
CVE-2021-45687
Updated
2026-11-02
EUVDEUVD-2022-0714 No score

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.

Record
EUVD-2022-0714
Updated
2026-11-03
GitHub AdvisoriesGHSA-w428-f65r-h4q2 9.8

Deserialization of Untrusted Data in rust-cpuid

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.

Record
GHSA-w428-f65r-h4q2
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-502
Updated
2026-11-02
GitHub AdvisoriesGHSA-jf5h-cf95-w759 No score

Optional `Deserialize` implementations lacking validation

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 use std::str::from_utf8_unchecked() internally).
  • Panics due to failed assertions.

See https://github.com/gz/rust-cpuid/issues/43.

Record
GHSA-jf5h-cf95-w759
Updated
2026-11-02
OSVGHSA-w428-f65r-h4q2 9.8

Deserialization of Untrusted Data in rust-cpuid

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.

Record
GHSA-w428-f65r-h4q2
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-502
Updated
2026-11-02
OSVGHSA-jf5h-cf95-w759 No score

Optional `Deserialize` implementations lacking validation

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 use std::str::from_utf8_unchecked() internally).
  • Panics due to failed assertions.

See https://github.com/gz/rust-cpuid/issues/43.

Record
GHSA-jf5h-cf95-w759
Updated
2026-11-02
OSVRUSTSEC-2021-0089 No score

Optional `Deserialize` implementations lacking validation

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 use std::str::from_utf8_unchecked() internally).
  • Panics due to failed assertions.

See https://github.com/gz/rust-cpuid/issues/43.

Record
RUSTSEC-2021-0089
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
raw-cpuid
crates.io
3.1.0 up to 9.1.1
9.1.1
raw-cpuid
crates.io
3.1.1-0 up to 9.1.1
9.1.1

History

History
RecordedChangedSources
aliasesEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2021-45687 is a critical vulnerability (CVSS 9.8) in Raw-cpuid Project Raw-cpuid, published January 20, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.16%, the 67th percentile. Fixed in raw-cpuid 9.1.1.

References

MoveEnter Open