When wasmi is built with simd but without memory64, some v128.store8_lane and v128.store16_lane instructions seem to be decoded wrong. In debug builds this panics; in release builds I got wrong results and sometimes a crash. Default builds have memory64 and look fine.
I think the decoder reads the offset of these instructions as a u64, while the encoder writes it as Offset, which is a u32 without memory64:
https://github.com/wasmi-labs/wasmi/blob/05d2de3057c323a3f807ef23eb19e0c2ab58d2a8/crates/ir/src/decode/op.rs#L270-L276
It happens when the vector comes from a local and the offset is 65536 or more, or the store goes to a memory other than 0. Changing the field to pub offset: Offset fixed it for me. I have a small patch with a test if that helps.
wasmi 2.0.2 with default-features = false, features = ["std", "validate", "simd"]:
(module
(memory (export "memory") 2)
(func (export "_start") (local v128)
(local.set 0 (v128.const i32x4 0x11223344 0x55667788 0x99aabbcc 0xddeeff00))
i32.const 0
local.get 0
v128.store8_lane offset=65536 3))
After _start, memory[65536] should be 0x11.
OpCode ... invalid bit pattern".memory64 on, all of them work as in Wasmtime.Builds of wasmi 2.0.0-beta.4 to 2.0.2 with simd and without memory64. A module can crash the host or get wrong results. I am not sure whether it can do more.
Fuente: NVD
Evaluación gratuita de vulnerabilidades
Evalúa tus prácticas de seguridad en la nube en 9 dominios de seguridad para evaluar tu nivel de riesgo e identificar brechas en tus defensas.
Obtén una demostración personalizada
"La mejor experiencia de usuario que he visto en mi vida, proporciona una visibilidad completa de las cargas de trabajo en la nube."
"Wiz proporciona un panel único para ver lo que ocurre en nuestros entornos en la nube."
"Sabemos que si Wiz identifica algo como crítico, en realidad lo es."