rustsec-2018-0022
Vulnerability from osv_rustsec
Published
2018-08-22 12:00
Modified
2023-06-13 13:10
Summary
Use of uninitialized memory in temporary
Details
Uninit memory is used as a RNG seed in temporary
The following function is used as a way to get entropy from the system, which does operations on and exposes uninit memory, which is UB.
fn random_seed(_: &Path, _: &str) -> [u64; 2] {
use std::mem::uninitialized as rand;
unsafe { [rand::<u64>() ^ 0x12345678, rand::<u64>() ^ 0x87654321] }
}
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 is an alternative for this crate.
{
"affected": [
{
"database_specific": {
"categories": [
"memory-exposure"
],
"cvss": null,
"informational": null
},
"ecosystem_specific": {
"affected_functions": null,
"affects": {
"arch": [],
"functions": [],
"os": []
}
},
"package": {
"ecosystem": "crates.io",
"name": "temporary",
"purl": "pkg:cargo/temporary"
},
"ranges": [
{
"events": [
{
"introduced": "0.3.0"
},
{
"fixed": "0.6.4"
}
],
"type": "SEMVER"
}
],
"versions": []
}
],
"aliases": [
"GHSA-2jq9-6xx7-3h29"
],
"database_specific": {
"license": "CC0-1.0"
},
"details": "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(_: \u0026Path, _: \u0026str) -\u003e [u64; 2] {\n use std::mem::uninitialized as rand;\n unsafe { [rand::\u003cu64\u003e() ^ 0x12345678, rand::\u003cu64\u003e() ^ 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.",
"id": "RUSTSEC-2018-0022",
"modified": "2023-06-13T13:10:24Z",
"published": "2018-08-22T12:00:00Z",
"references": [
{
"type": "PACKAGE",
"url": "https://crates.io/crates/temporary"
},
{
"type": "ADVISORY",
"url": "https://rustsec.org/advisories/RUSTSEC-2018-0022.html"
},
{
"type": "REPORT",
"url": "https://github.com/stainless-steel/temporary/issues/2"
}
],
"related": [],
"severity": [],
"summary": "Use of uninitialized memory in temporary"
}
Loading…
Loading…
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Loading…
Loading…