CVE-2022-31169Bytecodealliance Cranelift-codegen
High 7.5 No auth needed
Follow: this CVE · Bytecodealliance · Bytecodealliance Cranelift-codegen We alert you by email or Slack (account required).
- Priority
- 60
- CVSS 3.1
- 7.5
- EPSS
- 1.0% probability of exploitation in 30 days · percentile 61
- Auth required
- No
- Published
- Jul 22, 2022
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-682
- SSVC (CISA)
- Exploitation: none · Automatable: no · Technical impact: partial
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
What happens
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.
What to do
- Apply the vendor's security update for Cranelift-codegen.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| crates.io | cranelift-codegen |
< 0.85.2 |
0.85.2 |
cargo update -p cranelift-codegen --precise 0.85.2 |
| crates.io | wasmtime |
< 0.38.2 |
0.38.2 |
cargo update -p wasmtime --precise 0.38.2 |
| crates.io | wasmtime |
≥ 0.34.0 < 0.34.1 |
0.34.1 |
cargo update -p wasmtime --precise 0.34.1 |
| crates.io | wasmtime |
< 0.33.1 |
0.33.1 |
cargo update -p wasmtime --precise 0.33.1 |
| crates.io | wasmtime |
≥ 0.0.0-0 < 0.33.1 |
0.33.1 |
cargo update -p wasmtime --precise 0.33.1 |
| crates.io | wasmtime |
≥ 0.34.0 < 0.34.1 |
0.34.1 |
cargo update -p wasmtime --precise 0.34.1 |
| crates.io | wasmtime |
≥ 0.0.0-0 < 0.38.2 |
0.38.2 |
cargo update -p wasmtime --precise 0.38.2 |
Per OSV / GitHub Advisories (GHSA-7f6x-jwh5-m9r4, GHSA-88xq-w8cq-xfg7, RUSTSEC-2022-0096, RUSTSEC-2022-0101). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| bytecodealliance | cranelift-codegen | < 0.85.1 |
| bytecodealliance | wasmtime | < 0.38.1 |
Official sources
References
Links published by the sources. Open them with care.
- github.com Patch Third Party Advisory
- github.com Third Party Advisory