From fade8feebf25632280dde92239407c5f4bb39605 Mon Sep 17 00:00:00 2001 From: Safe4U Date: Sat, 6 Jul 2024 16:06:35 +0800 Subject: [PATCH 1/3] Add advisory for wasmtime_jit_debug --- .../wasmtime_jit_debug/RUSTSEC-0000-0000.md | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 crates/wasmtime_jit_debug/RUSTSEC-0000-0000.md diff --git a/crates/wasmtime_jit_debug/RUSTSEC-0000-0000.md b/crates/wasmtime_jit_debug/RUSTSEC-0000-0000.md new file mode 100644 index 0000000000..f662b50251 --- /dev/null +++ b/crates/wasmtime_jit_debug/RUSTSEC-0000-0000.md @@ -0,0 +1,25 @@ +```toml +[advisory] +id = "RUSTSEC-0000-0000" +package = "wasmtime_jit_debug" +date = "2024-07-06" +url = "https://github.com/bytecodealliance/wasmtime/issues/8905" +informational = "unsound" +categories = ["memory-exposure"] + +[affected] +functions = { "wasmtime_jit_debug::perf_jitdump::JitDumpFile::dump_code_load_record" = ["<= 22.0.0"] } + +[versions] +patched = [] +``` + +# Dump Undefined Memory by `JitDumpFile` + +The unsound function `dump_code_load_record` uses `from_raw_parts` to directly convert +the pointer `addr` and `len` into a slice without any validation and that memory block +would be dumped. + +Thus, the 'safe' function dump_code_load_record is actually 'unsafe' since it requires +the caller to guarantee that the addr is valid and len must not overflow. +Otherwise, the function could dump the memory into file illegally, causing memory leak. From 1de5b97441260fbc34c6f3ef3e2f49c7e048b12f Mon Sep 17 00:00:00 2001 From: Safe4U Date: Sat, 15 Feb 2025 11:09:25 +0800 Subject: [PATCH 2/3] Update affected and patched versions for wasmtime_jit_debug --- crates/wasmtime_jit_debug/RUSTSEC-0000-0000.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/wasmtime_jit_debug/RUSTSEC-0000-0000.md b/crates/wasmtime_jit_debug/RUSTSEC-0000-0000.md index f662b50251..b709655f9f 100644 --- a/crates/wasmtime_jit_debug/RUSTSEC-0000-0000.md +++ b/crates/wasmtime_jit_debug/RUSTSEC-0000-0000.md @@ -8,10 +8,10 @@ informational = "unsound" categories = ["memory-exposure"] [affected] -functions = { "wasmtime_jit_debug::perf_jitdump::JitDumpFile::dump_code_load_record" = ["<= 22.0.0"] } +functions = { "wasmtime_jit_debug::perf_jitdump::JitDumpFile::dump_code_load_record" = ["<= 24.0.0"] } [versions] -patched = [] +patched = [">= 24.0.0"] ``` # Dump Undefined Memory by `JitDumpFile` From 35e4ce2750f627dea37feb54c71406d2d3e76bf0 Mon Sep 17 00:00:00 2001 From: Safe4U Date: Sat, 15 Feb 2025 11:15:53 +0800 Subject: [PATCH 3/3] Fix package name to match crates.io --- .../RUSTSEC-0000-0000.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename crates/{wasmtime_jit_debug => wasmtime-jit-debug}/RUSTSEC-0000-0000.md (96%) diff --git a/crates/wasmtime_jit_debug/RUSTSEC-0000-0000.md b/crates/wasmtime-jit-debug/RUSTSEC-0000-0000.md similarity index 96% rename from crates/wasmtime_jit_debug/RUSTSEC-0000-0000.md rename to crates/wasmtime-jit-debug/RUSTSEC-0000-0000.md index b709655f9f..469fb0a6ab 100644 --- a/crates/wasmtime_jit_debug/RUSTSEC-0000-0000.md +++ b/crates/wasmtime-jit-debug/RUSTSEC-0000-0000.md @@ -1,7 +1,7 @@ ```toml [advisory] id = "RUSTSEC-0000-0000" -package = "wasmtime_jit_debug" +package = "wasmtime-jit-debug" date = "2024-07-06" url = "https://github.com/bytecodealliance/wasmtime/issues/8905" informational = "unsound"