Email me

Rust advisories / temporary

Vulnerability MediumRUSTSEC-2018-0022 · temporary

RUSTSEC-2018-0022: Use of uninitialized memory in temporary

Short answerA security vulnerability in the temporary crate: Use of uninitialized memory in temporary. GitHub rates it Medium. Fixed in 0.6.4: update to a fixed version.

Cratetemporary
TypeVulnerability (memory-exposure)
Affected versionsFrom 0.3.0 before 0.6.4.
Fixed in0.6.4
SeverityMedium (GitHub rating)
Published2018-08-22
Last changed2023-11-08
Also known asGHSA-2jq9-6xx7-3h29

What to do

  1. See which version you have: cargo tree -i temporary (it also shows which of your dependencies pulls it in).
  2. Update within your version requirement: cargo update -p temporary. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for example temporary = "0.6.4") or update the dependency that pulls it in.
  3. Check again with cargo audit, or paste your Cargo.lock into our Cargo.toml checker.

Details from the advisory

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.

References

From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.

Up next

Are you affected?Check your whole dependency treePaste Cargo.lock: every advisory, for your exact versions.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ