CVE-2022-31169

CVE-2022-31169 is a medium-severity security vulnerability in wasmtime (rust), affecting versions < 0.38.2. It is fixed in 0.38.2, 0.85.2.

Summary

Workarounds

If upgrading is not an option at this time, direct users of Cranelift that control the exact Cranelift instructions being compiled can avoid the vulnerability by explicitly extending constant divisors to 64 bits using either the sextend.i64 or the uextend.i64 operation.

Note, though, that this issue only affects the AArch64 targets. Other platforms are not affected.

For more information

If you have any questions or comments about this advisory:

Impact

There was a bug in Wasmtime's code generator, Cranelift, for AArch64 targets where constant divisors could result in incorrect division results at runtime. 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. For example, a constant 32-bit unsigned divisor of 0xfffffffe would be incorrectly sign-extended to 64-bits to 0xfffffffffffffffe. Any kind of division of operands smaller than 64 bits is implemented with a 64-bit division instruction which would then result in an incorrect result because the divisor was larger than expected.

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 was found with differential fuzzing of Wasmtime against other engines on the AArch64 platform. Fuzzing on AArch64 is not regularly performed at this time and the Wasmtime team is investigating how best to continuously fuzz AArch64 in the same manner as x86_64.

CVE-2022-31169 has a CVSS score of 5.9 (Medium). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (0.38.2, 0.85.2); upgrading removes the vulnerable code path.

Affected versions

wasmtime (< 0.38.2) cranelift-codegen (< 0.85.2)

Security releases

wasmtime → 0.38.2 (rust) cranelift-codegen → 0.85.2 (rust)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

See it in your environment

Remediation advice

This bug has been patched and users should upgrade to Wasmtime version 0.38.2.

Frequently Asked Questions

  1. What is CVE-2022-31169? CVE-2022-31169 is a medium-severity security vulnerability in wasmtime (rust), affecting versions < 0.38.2. It is fixed in 0.38.2, 0.85.2.
  2. How severe is CVE-2022-31169? CVE-2022-31169 has a CVSS score of 5.9 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which packages are affected by CVE-2022-31169?
    • wasmtime (rust) (versions < 0.38.2)
    • cranelift-codegen (rust) (versions < 0.85.2)
  4. Is there a fix for CVE-2022-31169? Yes. CVE-2022-31169 is fixed in 0.38.2, 0.85.2. Upgrade to this version or later.
  5. Is CVE-2022-31169 exploitable, and should I be worried? Whether CVE-2022-31169 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2022-31169 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2022-31169?
    • Upgrade wasmtime to 0.38.2 or later
    • Upgrade cranelift-codegen to 0.85.2 or later

Other vulnerabilities in wasmtime

CVE-2026-44216CVE-2026-35186CVE-2026-34987CVE-2026-35195CVE-2026-34988

Stop the waste.
Protect your environment with Kodem.