CVE-2022-31169

Cranelift vulnerable to miscompilation of constant values in division on AArch64

HIGH
7.5
CVSS Score
Published: July 21, 2022 at 01:50 PM UTC
Updated: June 17, 2026 at 04:44 AM UTC
2 products affected across 1 vendorWasmtimeCranelift Codegen

Using wasmtime by bytecodealliance?

Get instant alerts when new vulnerabilities affect wasmtime - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH7.5
Exploit prediction
EPSS 0.9%
SSVC
No known exploit

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.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 0.85.1
Affected range stops below 0.85.1, so it looks safe — our inference, not a vendor statement
v < 0.38.1v < 0.38.2v < 0.85.2
Affected range stops below 0.38.1, so it looks safe — our inference, not a vendor statement
Affected range stops below 0.38.2, so it looks safe — our inference, not a vendor statement
Affected range stops below 0.85.2, so it looks safe — our inference, not a vendor statement

Remediation

No guide yet

No remediation guidance has been written for this CVE yet. What the record does show:

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
NETWORK
Complexity
LOW
Privileges
NONE
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
HIGH
Availability
NONE
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-682

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card