CVE-2022-31169

Medium

Description

Wasmtime is a standalone runtime for WebAssembly. There is a bug in Wasmtime's code generator, Cranelift, for AArch64 targets where constant divisors can result in incorrect division results at runtime. This affects Wasmtime prior to version 0.38.2 and Cranelift prior to 0.85.2. This issue only affects the AArch64 platform. Other platforms are not affected. 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. The impact of this bug is that programs executing within the WebAssembly sandbox would not behave according to the WebAssembly specification. This means that 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. This bug has been patched in Wasmtime version 0.38.2 and cranelift-codegen 0.85.2. There are no known workarounds.

SeverityMedium
CVSS5.9
Exploit probability—
ProductBytecodealliance Cranelift-codegen
PublishedJul 22, 2022
First seenJul 22, 2022
Weakness typeCWE-682CWE-682

How to fix

Update
  • bytecodealliance cranelift-codegen0.85.1 or later
  • bytecodealliance wasmtime0.38.1 or later

Affected products

ProductAffected versionsFixed in
bytecodealliance cranelift-codegenv < 0.85.10.85.1
bytecodealliance wasmtimev < 0.38.10.38.1

Check your version

Choose the product and enter the version you run to see whether it falls in the affected range.

In the Intelligence 360 plan

Attack Surface Management

See the assets tied to your domains, the technologies they run and known vulnerabilities in one list.