PT-2022-20583 · Wasmtime+1 · Wasmtime+1

Akirilov-Arm

·

Published

2022-02-16

·

Updated

2022-08-03

·

CVE-2022-31169

CVSS v3.1

5.9

Medium

VectorAV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
Name of the Vulnerable Software and Affected Versions Wasmtime versions prior to 0.38.2 Cranelift versions prior to 0.85.2
Description There is a bug in Wasmtime's code generator, Cranelift, for AArch64 targets where constant divisors can result in incorrect division results at runtime. The translation rules for constants did not take into account whether sign or zero-extension should happen, which resulted in an incorrect value being placed into a register when a division was encountered. This means that programs executing within the WebAssembly sandbox would not behave according to the WebAssembly specification, and it is hypothetically possible for execution within the sandbox to go awry and WebAssembly programs could produce unexpected results. This should not impact hosts executing WebAssembly, but does affect the correctness of guest programs.
Recommendations For Wasmtime versions prior to 0.38.2, upgrade to Wasmtime version 0.38.2. For Cranelift versions prior to 0.85.2, upgrade to cranelift-codegen version 0.85.2. As a temporary workaround for direct users of Cranelift that control the exact Cranelift instructions being compiled, avoid the vulnerability by explicitly extending constant divisors to 64 bits using either the sextend.i64 or the uextend.i64 operation.

Exploit

Fix

Access of Uninitialized Pointer

Weakness Enumeration

Related Identifiers

CVE-2022-31169
GHSA-7F6X-JWH5-M9R4
GHSA-88XQ-W8CQ-XFG7
RUSTSEC-2022-0096
RUSTSEC-2022-0101

Affected Products

Cranelift
Wasmtime