GitHub Advisoryadvisory · crates.io

GHSA-jrf8-cmgg-gv2m Error on unsupported architectures in raw-cpuid

MEDIUM Published 2021-08-25 Modified 2023-06-13 Official page ↗
Aliases
CVE-2021-26307
Ecosystem
crates.io
Packages
raw-cpuid
Severity
Moderate
CVSS vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Weaknesses
CWE-400, CWE-657
Reviewed
2021-08-19

Affected packages

• crates.io raw-cpuid: < 9.0.0 → fixed in 9.0.0

Description

native_cpuid::cpuid_count() exposes the unsafe __cpuid_count() intrinsic from core::arch::x86 or core::arch::x86_64 as a safe function, and uses it internally, without checking the safety requirement: • The CPU the program is currently running on supports the function being called. CPUID is available in most, but not all, x86/x86_64 environments. The crate compiles only on these architectures, so others are unaffected. This issue is mitigated by the fact that affected programs are expected to crash deterministically every time. The flaw has been fixed in v9.0.0, by intentionally breaking compilation when targeting SGX or 32-bit x86 without SSE. This covers all affected CPUs.

Related

Alias · CVE (1)

  • CVE-2021-26307 An issue was discovered in the raw-cpuid crate before 9.0.0 for Rust. vulnerability

Weakness · CWE (2)

  • CWE-400 Uncontrolled Resource Consumption weakness
  • CWE-657 Violation of Secure Design Principles weakness

References