GitHub Advisoryadvisory · crates.io
GHSA-jf5h-cf95-w759 Optional `Deserialize` implementations lacking validation
MEDIUM
Official page ↗
- Ecosystem
- crates.io
- Packages
- raw-cpuid
- Severity
- Moderate
- Reviewed
- 2022-06-17
Affected packages
• crates.io raw-cpuid: >= 3.1.0, < 9.1.1 → fixed in 9.1.1
Description
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.