{"cve":"CVE-2022-31169","nvd":{"published":"2022-07-22T04:15:14.463","modified":"2026-06-17T04:44:57.170","status":"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.","cvss_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","score":7.5},"cwes":["CWE-682"],"references":["https://github.com/bytecodealliance/wasmtime/commit/2ba4bce5cc719e5a74e571a534424614e62ecc41","https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-7f6x-jwh5-m9r4","https://github.com/bytecodealliance/wasmtime/commit/2ba4bce5cc719e5a74e571a534424614e62ecc41","https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-7f6x-jwh5-m9r4"],"products":["bytecodealliance:cranelift-codegen","bytecodealliance:wasmtime"],"source":"nvd","synced_at":"2026-10-19T21:33:44.859608815+00:00"},"epss":{"cve":"CVE-2022-31169","score":0.00924,"percentile":0.60417,"date":"2026-10-31"},"kev":null,"osv":[{"id":"GHSA-7f6x-jwh5-m9r4","url":"https://osv.dev/vulnerability/GHSA-7f6x-jwh5-m9r4","summary":"Cranelift vulnerable to miscompilation of constant values in division on AArch64","modified":"2025-05-02T12:49:25Z","packages":[{"ecosystem":"crates.io","name":"wasmtime","purl":"pkg:cargo/wasmtime","ranges":["<0.38.2"],"fixed":["0.38.2"]},{"ecosystem":"crates.io","name":"cranelift-codegen","purl":"pkg:cargo/cranelift-codegen","ranges":["<0.85.2"],"fixed":["0.85.2"]}]},{"id":"GHSA-88xq-w8cq-xfg7","url":"https://osv.dev/vulnerability/GHSA-88xq-w8cq-xfg7","summary":"Invalid drop of partially-initialized instances in the pooling instance allocator for modules with defined `externref` globals ","modified":"2025-05-02T12:48:30Z","packages":[{"ecosystem":"crates.io","name":"wasmtime","purl":"pkg:cargo/wasmtime","ranges":[">=0.34.0 <0.34.1"],"fixed":["0.34.1"]},{"ecosystem":"crates.io","name":"wasmtime","purl":"pkg:cargo/wasmtime","ranges":["<0.33.1"],"fixed":["0.33.1"]}]},{"id":"RUSTSEC-2022-0096","url":"https://osv.dev/vulnerability/RUSTSEC-2022-0096","summary":"Invalid drop of VMExternRef from partially-initialized instances in the pooling instance allocator","modified":"2026-10-12T18:00:03.401494554Z","packages":[{"ecosystem":"crates.io","name":"wasmtime","purl":"pkg:cargo/wasmtime","ranges":[">=0.0.0-0 <0.33.1",">=0.34.0 <0.34.1"],"fixed":["0.33.1","0.34.1"]}]},{"id":"RUSTSEC-2022-0101","url":"https://osv.dev/vulnerability/RUSTSEC-2022-0101","summary":"Miscompilation of constant values in division on AArch64","modified":"2026-10-12T18:00:04.415945006Z","packages":[{"ecosystem":"crates.io","name":"wasmtime","purl":"pkg:cargo/wasmtime","ranges":[">=0.0.0-0 <0.38.2"],"fixed":["0.38.2"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}