From a4b1d48e55bb5644def194f1332367bbe3348667 Mon Sep 17 00:00:00 2001 From: Cyborus04 <87248184+Cyborus04@users.noreply.github.com> Date: Thu, 23 Sep 2021 16:25:05 -0400 Subject: [PATCH] nanorand `tls_rand` aliased mutable references (#1051) * nanorand `tls_rand` aliased mutable references * `TlsWyRand`, not `TlsRand` * Add report title whoops * Remove invalid category * add URL * "UB" -> "undefined behavior" Co-authored-by: Sergey "Shnatsel" Davidoff --- crates/nanorand/RUSTSEC-0000-0000.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 crates/nanorand/RUSTSEC-0000-0000.md diff --git a/crates/nanorand/RUSTSEC-0000-0000.md b/crates/nanorand/RUSTSEC-0000-0000.md new file mode 100644 index 0000000..9126b55 --- /dev/null +++ b/crates/nanorand/RUSTSEC-0000-0000.md @@ -0,0 +1,20 @@ +```toml +[advisory] +id = "RUSTSEC-0000-0000" +package = "nanorand" +date = "2021-09-23" +url = "https://github.com/Absolucy/nanorand-rs/issues/28" +keywords = ["memory-safety", "aliasing"] + +[versions] +patched = [">= 0.6.1"] +unaffected = ["< 0.5.0"] + +[affected] +functions = { "nanorand::tls::tls_rand" = [">= 0.5.0", "<= 0.6.0"] } +``` + +# Aliased mutable references from `tls_rand` & `TlsWyRand` + +`TlsWyRand`'s implementation of `Deref` unconditionally dereferences a raw pointer, and returns +multiple mutable references to the same object, which is undefined behavior.