From fade8feebf25632280dde92239407c5f4bb39605 Mon Sep 17 00:00:00 2001 From: Safe4U Date: Sat, 6 Jul 2024 16:06:35 +0800 Subject: [PATCH] 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 000000000..f662b5025 --- /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.