Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add advisory for unsound problem in wasmtime_jit_debug #1999

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions crates/wasmtime_jit_debug/RUSTSEC-0000-0000.md
Original file line number Diff line number Diff line change
@@ -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.