CVE-2022-31104: Miscompilation of `i8x16.swizzle` and `select` with v128 inputs in Wasmtime
bytecodealliance · wasmtime
Affected: bytecodealliance wasmtime · Exploitation: possible (1 to 10%)
Not in CyberSIXT coverage yet: no article names this CVE. This page shows the public record.
Higher than 78% of scored CVEs
DescriptionCVE.org
Wasmtime is a standalone runtime for WebAssembly. In affected versions wasmtime's implementation of the SIMD proposal for WebAssembly on x86_64 contained two distinct bugs in the instruction lowerings implemented in Cranelift. The aarch64 implementation of the simd proposal is not affected. The bugs were presented in the `i8x16.swizzle` and `select` WebAssembly instructions. The `select` instruction is only affected when the inputs are of `v128` type. The correspondingly affected Cranelift instructions were `swizzle` and `select`. The `swizzle` instruction lowering in Cranelift erroneously overwrote the mask input register which could corrupt a constant value, for example. This means that future uses of the same constant may see a different value than the constant itself. The `select` instruction lowering in Cranelift wasn't correctly implemented for vector types that are 128-bits wide. When the condition was 0 the wrong instruction was used to move the correct input to the output of the instruction meaning that only the low 32 bits were moved and the upper 96 bits of the result were left as whatever the register previously contained (instead of the input being moved from). The `select` instruction worked correctly if the condition was nonzero, however. This bug in Wasmtime's implementation of these instructions on x86_64 represents an incorrect implementation of the specified semantics of these instructions according to the WebAssembly specification. The impact of this is benign for hosts running WebAssembly but represents possible vulnerabilities within the execution of a guest program. For example a WebAssembly program could take unintended branches or materialize incorrect values internally which runs the risk of exposing the program itself to other related vulnerabilities which can occur from miscompilations.
Affected products1
From the CVE record. A product or version that is not listed is unknown, not unaffected.
- bytecodealliance · wasmtimewasmtime: < 0.38.1; cranelift-codegen: < 0.85.0
On the Atlas
Every published CVE is on the CyberSIXT Atlas, grouped by weakness, vendor and month.
- Exploitation
- Possible (1 to 10%). EPSS between 1% and 10%.
- CISA KEV
- Not listed
- Public check
- No public nuclei template
- Vendor
- bytecodealliance
- Published
- June 2022
CoverageNo articles yet
No CyberSIXT article names CVE-2022-31104 yet, so there is no coverage timeline, action brief or change log for it. Everything on this page comes from the public CVE record, CISA KEV, EPSS and the nuclei template index. Search the archive or see the CVEs in the news.
References
- NVD entrynvd.nist.gov
- CVE recordcve.org
- Weakness CWE-682cwe.mitre.org
- github.com/bytecodealliance/wasmtime/security/advisories/GHSA-jqgithub.com
- github.com/bytecodealliance/wasmtime/pull/4317github.com
- github.com/bytecodealliance/wasmtime/pull/4318github.com
- docs.rs/wasmtime/latest/wasmtime/struct.Config.html#method.wasm_docs.rs
- github.com/webassembly/simdgithub.com
- webassembly.github.io/specwebassembly.github.io