Advisory

RUSTSEC-2021-0089

Also known as: CVE-2021-45687, GHSA-jf5h-cf95-w759, GHSA-w428-f65r-h4q2

Summary

Optional Deserialize implementations lacking validation

Details

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.

Severity

Not rated by the source.

Dates

Published
2021-01-20 12:00 UTC
Modified
2023-11-08 04:07 UTC

Affected packages and fixes

raw-cpuid

crates.io · All systems

Affected

  • introduced 3.1.1-0, fixed 9.1.1 (semver)

Fixed versions

9.1.1

Fix

  • Fixed version 9.1.1
    cargo update -p raw-cpuid --precise 9.1.1

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: RustSec Advisory Database · CC0-1.0

Sources & licences