Files
vuln-osv/data/crates.io/RUSTSEC-2020-0009.json
T

1 line
1.7 KiB
JSON

{"schema_version":"1.7.3","id":"RUSTSEC-2020-0009","published":"2020-04-11T12:00:00Z","modified":"2023-11-08T04:03:36.276800Z","aliases":["CVE-2020-35864","GHSA-c9h5-hf8r-m97x"],"summary":"`read_scalar` and `read_scalar_at` allow transmuting values without `unsafe` blocks","details":"The `read_scalar` and `read_scalar_at` functions are unsound\nbecause they allow transmuting values without `unsafe` blocks.\n\nThe following example shows how to create a dangling reference:\n\n```\nfn main() {\n #[derive(Copy, Clone, PartialEq, Debug)]\n struct S(&'static str);\n impl flatbuffers::EndianScalar for S {\n fn to_little_endian(self) -> Self { self }\n fn from_little_endian(self) -> Self { self }\n }\n println!(\"{:?}\", flatbuffers::read_scalar::<S>(&[1; std::mem::size_of::<S>()]));\n}\n```","affected":[{"package":{"name":"flatbuffers","ecosystem":"crates.io","purl":"pkg:cargo/flatbuffers"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.4.0"},{"fixed":"2.0.0"}]}],"ecosystem_specific":{"affected_functions":null,"affects":{"arch":[],"functions":["flatbuffers::read_scalar","flatbuffers::read_scalar_at"],"os":[]}},"database_specific":{"categories":[],"cvss":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","informational":null,"source":"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2020-0009.json"}}],"references":[{"type":"PACKAGE","url":"https://crates.io/crates/flatbuffers"},{"type":"ADVISORY","url":"https://rustsec.org/advisories/RUSTSEC-2020-0009.html"},{"type":"REPORT","url":"https://github.com/google/flatbuffers/issues/5825"}],"database_specific":{"license":"CC0-1.0"},"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"}]}