RUSTSEC-2018-0022

Source
https://rustsec.org/advisories/RUSTSEC-2018-0022
Import Source
https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2018-0022.json
JSON Data
https://api.osv.dev/v1/vulns/RUSTSEC-2018-0022
Aliases
Published
2018-08-22T12:00:00Z
Modified
2023-11-08T04:14:07.505706Z
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.

Database specific
{
    "license": "CC0-1.0"
}
References

Affected packages

crates.io / temporary

Package

Affected ranges

Type
SEMVER
Events
Introduced
0.3.0
Fixed
0.6.4

Ecosystem specific

{
    "affected_functions": null,
    "affects": {
        "os": [],
        "functions": [],
        "arch": []
    }
}

Database specific

{
    "cvss": null,
    "informational": null,
    "categories": [
        "memory-exposure"
    ]
}