CVE-2021-45687
JSON

9.8critical

Optional `Deserialize` implementations lacking validation

Severity
9.8critical CVSS:3.1 by NVD
Exploit likelihood
1.16% (higher than 68% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
mitre
Also known as
GHSA-jf5h-cf95-w759GHSA-w428-f65r-h4q2RUSTSEC-2021-0089

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.

Affected

Product or packageVersionsReported by
Unspecified productn/aCVE List
raw-cpuid (crates.io)from 3.1.0 before 9.1.1, from 3.1.1-0 before 9.1.1GitHub Advisory Database, RustSec Advisory Database
raw-cpuid_project raw-cpuidbefore 9.1.1NVD

All scores

GitHubmedium rating
GitHub9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD6.8medium CVSS:2.0AV:N/AC:M/Au:N/C:P/I:P/A:P

Classification

What each source says

CVE List

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.

GitHub Advisory Database

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.

NVD (es)

Se ha detectado un problema en la crate raw-cpuid versiones anteriores a 9.1.1 para Rust. Si es usada la funcionalidad serialize (que no es la predeterminada), una operación de deserialización puede carecer de la suficiente comprobación, conllevando a una corrupción de memoria o un pánico

References

Sources

SourceRecordLicence
CVE ListCVE-2021-45687 changed 2024-08-04CVE Terms of Use
GitHub Advisory DatabaseGHSA-jf5h-cf95-w759 changed 2023-11-08CC-BY-4.0
GitHub Advisory DatabaseGHSA-w428-f65r-h4q2 changed 2023-11-08CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2021-0089 changed 2023-11-08CC0-1.0
NVDCVE-2021-45687 changed 2026-06-17Public domain