
Demonstrates a critical WebAssembly OOB read/write via table index confusion, leaking host memory and potentially enabling code execution in WASM runtimes.
A WebAssembly module uses an imported function with no bounds check on an array index. An attacker can supply an out-of-bounds index to read or write outside the linear memory, potentially leaking host secrets or achieving code execution in the WASM runtime.
unsafe code offsetting a raw pointer without clamping the index to the array length.rustup target add wasm32-unknown-unknown
rustc --target wasm32-unknown-unknown -O wasm_vuln.rs -o wasm_vuln.wasm
pip install wasmer wasmer_compiler_cranelift
python exploit_wasm_oob.py
The output shows a memory value from outside the array.