# CVE-2022-31169: Cranelift vulnerable to miscompilation of constant values in division on AArch64

- Severity: Medium 5.9 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.95%, higher than 62% of CVEs (2026-12-01)
- Published: 2022-02-16T22:35:03.000Z
- Modified: 2026-10-12T18:00:04.415Z
- Also known as: GHSA-7f6x-jwh5-m9r4, GHSA-88xq-w8cq-xfg7, RUSTSEC-2022-0096, RUSTSEC-2022-0101
- Related: CVE-2022-23636
- Weaknesses: CWE-682, CWE-824
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- bytecodealliance wasmtime: < 0.38.2; < 0.85.2; before 0.38.1
- wasmtime (crates.io): before 0.38.2; from 0.34.0 before 0.34.1; before 0.33.1; from 0.0.0-0 before 0.33.1; from 0.0.0-0 before 0.38.2
- cranelift-codegen (crates.io): before 0.85.2
- bytecodealliance cranelift-codegen: before 0.85.1

## Every score

- GitHub_M: CVSS:3.1 5.9 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N`
- GitHub: CVSS:3.1 5.9 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N`
- GitHub: CVSS:3.1 5.1 Medium `CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H`
- NVD: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`

## References

- <https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-7f6x-jwh5-m9r4> (third-party-advisory, web)
- <https://github.com/bytecodealliance/wasmtime/commit/2ba4bce5cc719e5a74e571a534424614e62ecc41> (patch, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2022-31169> (advisory)
- <https://github.com/bytecodealliance/wasmtime> (package)
- <https://rustsec.org/advisories/RUSTSEC-2022-0101.html> (advisory, web)
- <https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-88xq-w8cq-xfg7> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2022-23636> (advisory)
- <https://github.com/bytecodealliance/wasmtime/commit/886ecc562040bef61faf19438c22285c2d62403a> (web)
- <https://rustsec.org/advisories/RUSTSEC-2022-0096.html> (advisory, web)
- <https://crates.io/crates/wasmtime> (package)

## Sources

- CVE List: [CVE-2022-31169](https://www.cve.org/CVERecord?id=CVE-2022-31169), CVE Terms of Use, modified 2025-04-23
- GitHub Advisory Database: [GHSA-7f6x-jwh5-m9r4](https://github.com/advisories/GHSA-7f6x-jwh5-m9r4), CC-BY-4.0, modified 2025-05-02
- GitHub Advisory Database: [GHSA-88xq-w8cq-xfg7](https://github.com/advisories/GHSA-88xq-w8cq-xfg7), CC-BY-4.0, modified 2025-05-02
- RustSec Advisory Database: [RUSTSEC-2022-0096](https://rustsec.org/advisories/RUSTSEC-2022-0096.html), CC0-1.0, modified 2026-10-12
- RustSec Advisory Database: [RUSTSEC-2022-0101](https://rustsec.org/advisories/RUSTSEC-2022-0101.html), CC0-1.0, modified 2026-10-12
- NVD: [CVE-2022-31169](https://nvd.nist.gov/vuln/detail/CVE-2022-31169), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-31169 · Whole record: https://cve.day/CVE-2022-31169.json · Rebuilt by cve.day 2026-11-25T22:58:13.158Z
