CVE-2020-35864
HIGH7.5EPSS 0.17%`read_scalar` and `read_scalar_at` allow transmuting values without `unsafe` blocks
發布日:2021/8/25修改日:2023/11/8
描述
The `read_scalar` and `read_scalar_at` functions are unsound because they allow transmuting values without `unsafe` blocks. The following example shows how to create a dangling reference: ``` fn main() { #[derive(Copy, Clone, PartialEq, Debug)] struct S(&'static str); impl flatbuffers::EndianScalar for S { fn to_little_endian(self) -> Self { self } fn from_little_endian(self) -> Self { self } } println!("{:?}", flatbuffers::read_scalar::<S>(&[1; std::mem::size_of::<S>()])); } ```
受影響套件(2)
- crates.io/flatbuffers>= 0.4.0, < 2.0.0
- crates.io/flatbuffers>= 0.4.0, < 2.0.0
CVSS 分數
| 來源 | 版本 | 嚴重程度 | 向量 |
|---|---|---|---|
| osv | CVSS 3.1 | HIGH7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |