{"id":"CVE-2021-26307","aliases":["EUVD-2021-1784","GHSA-hvqc-pc78-x9wh","GHSA-jrf8-cmgg-gv2m","RUSTSEC-2021-0013"],"status":"published","title":"Error on unsupported architectures in raw-cpuid","description":"An issue was discovered in the raw-cpuid crate before 9.0.0 for Rust. It allows __cpuid_count() calls even if the processor does not support the CPUID instruction, which is unsound and causes a deterministic crash.","severity":{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","level":"medium","assessor":"primary","from":"nvd"},"epss":{"day":"2026-11-11","score":0.00346,"percentile":0.2849,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-198","CWE-400","CWE-657"],"published":"2021-01-20T12:00:00Z","modified":"2026-06-17T03:43:05Z","fixes":[{"ecosystem":"crates.io","package":"raw-cpuid","fixed_in":["9.0.0"],"sources":["ghsa"]}],"affected":[{"source":"ghsa","ecosystem":"crates.io","package":"raw-cpuid","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"9.0.0"}]}]},{"source":"osv","ecosystem":"crates.io","package":"raw-cpuid","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"9.0.0"}]}],"bundled":2},{"source":"osv","ecosystem":"crates.io","package":"raw-cpuid","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"9.0.0"}]}],"bundled":2},{"source":"osv","ecosystem":"crates.io","package":"raw-cpuid","ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"9.0.0"}]}],"bundled":2}],"products":[{"vendor":"raw-cpuid_project","product":"raw-cpuid"}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2021-0013.html","tags":["x_refsource_MISC","x_transferred","Exploit","Vendor Advisory","web","advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-26307","tags":["advisory"]},{"url":"https://github.com/gz/rust-cpuid/issues/40","tags":["web"]},{"url":"https://github.com/RustSec/advisory-db/pull/614","tags":["web"]},{"url":"https://github.com/gz/rust-cpuid/commit/91b676eecd01f2163e2984215e2c0ac89e30ce75","tags":["web"]},{"url":"https://github.com/gz/rust-cpuid/issues/41","tags":["web"]},{"url":"https://github.com/advisories/GHSA-jrf8-cmgg-gv2m"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-26306","tags":["advisory"]},{"url":"https://github.com/gz/rust-cpuid","tags":["package"]},{"url":"https://crates.io/crates/raw-cpuid","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2021-26307","description":"An issue was discovered in the raw-cpuid crate before 9.0.0 for Rust. It allows __cpuid_count() calls even if the processor does not support the CPUID instruction, which is unsound and causes a deterministic crash.","status":"published","published":"2021-01-29T02:27:17Z","modified":"2024-08-03T20:19:20.4Z","updated_at":"2026-11-02T14:32:57.368269Z"}],"euvd":[{"id":"EUVD-2021-1784","description":"An issue was discovered in the raw-cpuid crate before 9.0.0 for Rust. It allows __cpuid_count() calls even if the processor does not support the CPUID instruction, which is unsound and causes a deterministic crash.","status":"published","published":"2021-01-29T02:27:17Z","modified":"2024-08-03T20:19:20Z","updated_at":"2026-11-03T03:24:51.962182Z"}],"ghsa":[{"id":"GHSA-jrf8-cmgg-gv2m","title":"Error on unsupported architectures in raw-cpuid","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:\n\n* The CPU the program is currently running on supports the function being called.\n\nCPUID 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.\n\nThe 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.","status":"published","published":"2021-08-25T20:53:07Z","modified":"2023-06-13T20:29:55Z","cvss":[{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","level":"medium"}],"cwes":["CWE-400","CWE-657"],"updated_at":"2026-11-02T14:36:54.225318Z"}],"nvd":[{"id":"CVE-2021-26307","description":"An issue was discovered in the raw-cpuid crate before 9.0.0 for Rust. It allows __cpuid_count() calls even if the processor does not support the CPUID instruction, which is unsound and causes a deterministic crash.","status":"published","published":"2021-01-29T03:15:12.49Z","modified":"2026-06-17T03:43:05.003Z","cvss":[{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","level":"medium","assessor":"primary"},{"version":"2.0","score":2.1,"vector":"AV:L/AC:L/Au:N/C:N/I:N/A:P","level":"low","assessor":"primary"}],"updated_at":"2026-11-02T14:06:49.660551Z"}],"osv":[{"id":"GHSA-hvqc-pc78-x9wh","title":"Soundness issue in raw-cpuid","description":"VendorInfo::as_string(), SoCVendorBrand::as_string(), and ExtendedFunctionInfo::processor_brand_string() construct byte slices using std::slice::from_raw_parts(), with data coming from #[repr(Rust)] structs. This is always undefined behavior.\nThis flaw has been fixed in v9.0.0, by making the relevant structs #[repr(C)].","status":"published","published":"2021-08-25T20:53:10Z","modified":"2023-11-08T04:05:20.849093Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"cwes":["CWE-198","CWE-400"],"updated_at":"2026-11-02T15:46:49.621585Z"},{"id":"GHSA-jrf8-cmgg-gv2m","title":"Error on unsupported architectures in raw-cpuid","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:\n\n* The CPU the program is currently running on supports the function being called.\n\nCPUID 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.\n\nThe 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.","status":"published","published":"2021-08-25T20:53:07Z","modified":"2023-11-08T04:05:20.849093Z","cvss":[{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","level":"medium"}],"cwes":["CWE-400","CWE-657"],"updated_at":"2026-11-02T15:46:50.687609Z"},{"id":"RUSTSEC-2021-0013","title":"Soundness issues in `raw-cpuid`","description":"## Undefined behavior in `as_string()` methods\n\n`VendorInfo::as_string()`, `SoCVendorBrand::as_string()`,\nand `ExtendedFunctionInfo::processor_brand_string()` construct byte slices\nusing `std::slice::from_raw_parts()`, with data coming from\n`#[repr(Rust)]` structs. This is always undefined behavior.\n\nSee https://github.com/gz/rust-cpuid/issues/40.\n\nThis flaw has been fixed in v9.0.0, by making the relevant structs\n`#[repr(C)]`.\n\n## `native_cpuid::cpuid_count()` is unsound\n\n`native_cpuid::cpuid_count()` exposes the unsafe `__cpuid_count()` intrinsic\nfrom `core::arch::x86` or `core::arch::x86_64` as a safe function, and uses\nit internally, without checking the\n[safety requirement](https://doc.rust-lang.org/core/arch/index.html#overview):\n\n\u003e The CPU the program is currently running on supports the function being\n\u003e called.\n\nCPUID is available in most, but not all, x86/x86_64 environments. The crate\ncompiles only on these architectures, so others are unaffected.\n\nThis issue is mitigated by the fact that affected programs are expected\nto crash deterministically every time.\n\nSee https://github.com/gz/rust-cpuid/issues/41.\n\nThe flaw has been fixed in v9.0.0, by intentionally breaking compilation\nwhen targeting SGX or 32-bit x86 without SSE. This covers all affected CPUs.","status":"published","published":"2021-01-20T12:00:00Z","modified":"2023-11-08T04:05:20.849093Z","updated_at":"2026-11-02T15:53:39.492624Z"}]}}
