{"id":"CVE-2020-35864","aliases":["CVE-2020-35864","GHSA-c9h5-hf8r-m97x","RUSTSEC-2020-0009"],"related":[],"kind":"vulnerability","state":"published","title":"Dangling reference in flatbuffers","summary":"An issue was discovered in the flatbuffers crate through 2020-04-11 for Rust. read_scalar (and read_scalar_at) can transmute values without unsafe blocks.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"An issue was discovered in the flatbuffers crate through 2020-04-11 for Rust. read_scalar (and read_scalar_at) can transmute values without unsafe blocks.","source":"cvelist"},{"lang":"en","text":"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```","format":"markdown","source":"rustsec"},{"lang":"es","text":"Se detectó un problema en la crate flatbuffers hasta el 11-04-2020 para Rust.&#xa0;La función read_scalar (y read_scalar_at) pueden transmutar valores sin bloques no seguros.","source":"nvd"}],"published":"2020-04-11T12:00:00.000Z","modified":"2026-06-17T03:14:29.397Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"RustSec Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:N/I:N/A:P","score":5,"rating":"MEDIUM"}],"cwes":["CWE-704"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.4.0","status":"affected","fixed":"2.0.0"}],"ecosystem":"crates.io","package":"flatbuffers","purl":"pkg:cargo/flatbuffers","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.4.0","status":"affected","fixed":"2.0.0"}],"ecosystem":"crates.io","package":"flatbuffers","purl":"pkg:cargo/flatbuffers","source":"rustsec"},{"ranges":[{"status":"affected","introduced":"0.4.0","lastAffected":"1.12.0"}],"vendor":"google","product":"flatbuffers","cpe":"cpe:2.3:a:google:flatbuffers:*:*:*:*:*:rust:*:*","source":"nvd"}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2020-0009.html","tags":["advisory","exploit","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","rustsec","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2020-35864","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/google/flatbuffers/issues/5825","tags":["report","web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/google/flatbuffers","tags":["package"],"sources":["ghsa"]},{"url":"https://crates.io/crates/flatbuffers","tags":["package"],"sources":["rustsec"]}],"credits":[],"assigner":"mitre","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2020-35864","url":"https://www.cve.org/CVERecord?id=CVE-2020-35864","licence":"CVE Terms of Use","modified":"2024-08-04T17:16:12.667Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-c9h5-hf8r-m97x","url":"https://github.com/advisories/GHSA-c9h5-hf8r-m97x","licence":"CC-BY-4.0","modified":"2023-11-08T04:03:36.276Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2020-0009","url":"https://rustsec.org/advisories/RUSTSEC-2020-0009.html","licence":"CC0-1.0","modified":"2023-11-08T04:03:36.276Z"},{"source":"nvd","name":"NVD","id":"CVE-2020-35864","url":"https://nvd.nist.gov/vuln/detail/CVE-2020-35864","licence":"Public domain","modified":"2026-06-17T03:14:29.397Z"}],"updatedAt":"2026-11-25T22:57:56.668Z","epss":{"score":0.00591,"percentile":0.49626,"date":"2026-12-02T12:00:21.000Z"}}