Out-of-bounds zero-length stream writes can panic
Description
Wasmtime's API bindings to component model streams contained a bug where a panic could be triggered when the guest performed a zero-length read or write using an out-of-bounds address. The component model specification says that in this situation the address is not validated, which Wasmtime adheres to, but this lack of validation wasn't accounted for when Wasmtime later indexed into guest linear memory and this could trigger a panic.
Details
This bug only affects users of the Direct{Source,Destination} APIs, specifically the remaining method. These APIs are used by Wasmtime's implementation of WASIp3 which means that all embedders providing access to Wasmtime's WASIp3 implementation are affected.
Impact
All embedders which provide access to Wasmtime's WASIp3 implementation in the wasmtime-wasi crate are affected, as well as embedders which use the Direct{Source,Destination}::remaining function directly.