wasmtime vulnerable to miscompilation of `i8x16.select` with the same inputs on x86_64
bytecodealliance wasmtime
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| wasmtime crates.io |
|
|
| cranelift-codegen |
bytecodealliance wasmtime
| Product | Affected | Fixed in |
|---|---|---|
| wasmtime crates.io |
|
|
| cranelift-codegen |
|
|
wasmtime is a fast and secure runtime for WebAssembly. Wasmtime's code generation backend, Cranelift, has a bug on x86_64 platforms for the WebAssembly `i8x16.select` instruction which will produce the wrong results when the same operand is provided to the instruction and some of the selected indices are greater than 16. There is an off-by-one error in the calculation of the mask to the `pshufb` instruction which causes incorrect results to be returned if lanes are selected from the second vector. This codegen bug has been fixed in Wasmtiem 6.0.1, 5.0.1, and 4.0.1. Users are recommended to upgrade to these updated versions. If upgrading is not an option for you at this time, you can avoid this miscompilation by disabling the Wasm simd proposal. Additionally the bug is only present on x86_64 hosts. Other platforms such as AArch64 and s390x are not affected.
From the CVE record · GitHub_M
On x86_64 hosts, Cranelift can generate incorrect results for a WebAssembly `i8x16.select` instruction when the same operand is provided and some selected indices are greater than 16. WebAssembly code using that instruction can therefore return wrong results; the input does not specify network access, authentication requirements, or user interaction. AArch64 and s390x hosts are not affected.
Engineers running Wasmtime before 4.0.1 in the 4.x line, before 5.0.1 in the 5.x line, or before 6.0.1 in the 6.x line, or using affected cranelift-codegen releases from the 0.88–0.93 lines, should check their deployments.