{"id":"GHSA-2jq9-6xx7-3h29","aliases":["GHSA-2jq9-6xx7-3h29","RUSTSEC-2018-0022"],"related":[],"kind":"vulnerability","state":"published","title":"`temporary` makes use of uninitialized memory","summary":"Uninitialized memory is used as a RNG seed in temporary. This has been resolved in the 0.6.4 release. The crate is not intended to be used outside of a testing environment. For a general purpose crate to create temporary directories, [`tempfile`](https://crates.io/crates/tempfile) is an alternative for this crate.","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"Uninitialized memory is used as a RNG seed in temporary. This has been resolved in the 0.6.4 release. The crate is not intended to be used outside of a testing environment. For a general purpose crate to create temporary directories, [`tempfile`](https://crates.io/crates/tempfile) is an alternative for this crate.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Uninit memory is used as a RNG seed in temporary\n\nThe following function is used as a way to get entropy from the system, which does operations on and exposes uninit memory, which is UB.\n\n```rust\nfn random_seed(_: &Path, _: &str) -> [u64; 2] {\n    use std::mem::uninitialized as rand;\n    unsafe { [rand::<u64>() ^ 0x12345678, rand::<u64>() ^ 0x87654321] }\n}\n```\n\nThis has been resolved in the 0.6.4 release.\n\nThe crate is not intended to be used outside of a testing environment.\n\nFor a general purpose crate to create temporary directories, [`tempfile`](https://crates.io/crates/tempfile) is an alternative for this crate.","format":"markdown","source":"rustsec"}],"published":"2018-08-22T12:00:00.000Z","modified":"2023-11-08T04:14:07.505Z","severity":{"scorer":"GitHub","scheme":"rating","rating":"MEDIUM"},"severities":[{"scorer":"GitHub","scheme":"rating","rating":"MEDIUM"}],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0.3.0","status":"affected","fixed":"0.6.4"}],"ecosystem":"crates.io","package":"temporary","purl":"pkg:cargo/temporary","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.3.0","status":"affected","fixed":"0.6.4"}],"ecosystem":"crates.io","package":"temporary","purl":"pkg:cargo/temporary","source":"rustsec"}],"references":[{"url":"https://github.com/stainless-steel/temporary/issues/2","tags":["report","web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/stainless-steel/temporary","tags":["package"],"sources":["ghsa"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2018-0022.html","tags":["advisory","web"],"sources":["ghsa","rustsec"]},{"url":"https://crates.io/crates/temporary","tags":["package"],"sources":["rustsec"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-2jq9-6xx7-3h29","url":"https://github.com/advisories/GHSA-2jq9-6xx7-3h29","licence":"CC-BY-4.0","modified":"2023-11-08T04:14:07.505Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2018-0022","url":"https://rustsec.org/advisories/RUSTSEC-2018-0022.html","licence":"CC0-1.0","modified":"2023-11-08T04:14:07.505Z"}],"updatedAt":"2026-11-25T22:56:42.924Z"}