CVE-2022-23636
Cranelift vulnerable to miscompilation of constant values in division on AArch64
Also known as CVE-2022-31169, GHSA-7f6x-jwh5-m9r4, GHSA-88xq-w8cq-xfg7, RUSTSEC-2022-0096, RUSTSEC-2022-0101
Mitigation
- Upgrade wasmtime to one of 0.38.2, 0.34.1, 0.33.1 (or later in the same release line).
- Upgrade cranelift-codegen to 0.85.2 or later.
Who should check
- Projects that depend on crates.io package wasmtime (< 0.38.2)
- Projects that depend on crates.io package cranelift-codegen (< 0.85.2)
- Anyone running bytecodealliance wasmtime < 0.38.2; < 0.85.2
Vulnerability facts
- Affected
- wasmtime < 0.38.2; cranelift-codegen < 0.85.2
- Fixed in
- 0.38.2, 0.34.1, 0.33.1, 0.85.2
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Remote, no login needed
- CVSS
- 5.9 (v3.1, CNA)CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:NOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Network
- Attack complexity: High
- Privileges required: None
- User interaction: None
- Scope: Unchanged
- Confidentiality impact: None
- Integrity impact: High
- Availability impact: None
- EPSS
- 0.73% chance of exploitation in 30 days (percentile 50, 2026-11-26)
- CWE
- CWE-682
- Modified
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 and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| crates.io wasmtime | < 0.38.2 | 0.38.2, 0.34.1, 0.33.1 | osv |
| crates.io cranelift-codegen | < 0.85.2 | 0.85.2 | osv |
| bytecodealliance wasmtime | < 0.38.2; < 0.85.2 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2022-23636. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2022-23636.md Affected: wasmtime < 0.38.2; cranelift-codegen < 0.85.2 Fixed in: 0.38.2, 0.34.1, 0.33.1, 0.85.2 Steps: 1. Search this machine and project for wasmtime (crates.io), cranelift-codegen (crates.io), bytecodealliance wasmtime: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
- https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-7f6x-jwh5-m9r4
- https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-88xq-w8cq-xfg7
- https://nvd.nist.gov/vuln/detail/CVE-2022-31169
- https://rustsec.org/advisories/RUSTSEC-2022-0101.html
- https://nvd.nist.gov/vuln/detail/CVE-2022-23636
- https://rustsec.org/advisories/RUSTSEC-2022-0096.html
Patches
FAQ
Is CVE-2022-23636 being exploited?
There is no confirmed exploitation: CVE-2022-23636 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.73% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2022-23636?
Medium: CVSS 5.9 (v3.1, scored by CNA). Remote, no login needed. The attack needs conditions outside the attacker's control, which makes it harder.
Which versions are affected by CVE-2022-23636?
wasmtime < 0.38.2; cranelift-codegen < 0.85.2.
Is there a fix for CVE-2022-23636?
Yes. Fixed in 0.38.2, 0.34.1, 0.33.1, 0.85.2. Upgrade wasmtime to one of 0.38.2, 0.34.1, 0.33.1 (or later in the same release line). Upgrade cranelift-codegen to 0.85.2 or later.
How do I check if I'm affected by CVE-2022-23636?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.