
Cloud Vulnerability DB
A community-led vulnerabilities database
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.
Source: NVD
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."