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

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.9
- **CVSS:** 5.9 (v3.1, CNA) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N`
- **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
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 0.73% (percentile 50, 2026-11-26)
- **CWE:** CWE-682
- **Aliases:** CVE-2022-31169, GHSA-7f6x-jwh5-m9r4, GHSA-88xq-w8cq-xfg7, RUSTSEC-2022-0096, RUSTSEC-2022-0101
- **Published:** 2022-02-16T22:00:10.000Z
- **Modified:** 2026-10-12T18:00:04.415Z

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

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

- crates.io `wasmtime`: affected \< 0.38.2; fixed 0.38.2, 0.34.1, 0.33.1 (osv)
- crates.io `cranelift-codegen`: affected \< 0.85.2; fixed 0.85.2 (osv)
- bytecodealliance wasmtime: \< 0.38.2; \< 0.85.2 (cvelist)

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

## Check your systems with an agent

Paste this into a coding agent:

```text
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.
```

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

## References

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

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2022-23636>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-7f6x-jwh5-m9r4> (license: <https://creativecommons.org/licenses/by/4.0/>)
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-88xq-w8cq-xfg7> (license: <https://creativecommons.org/licenses/by/4.0/>)
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/RUSTSEC-2022-0096> (license: <https://creativecommons.org/licenses/by/4.0/>)
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/RUSTSEC-2022-0101> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2022-23636> · JSON: <https://flawdb.com/api/v1/entries/CVE-2022-23636>
