CVE-2022-39394

CVE-2022-39394 is a low-severity out-of-bounds write vulnerability in wasmtime (rust), affecting versions >= 2.0.0, < 2.0.2. It is fixed in 2.0.2, 1.0.2.

Summary

Workarounds

This can be worked around by providing a 4-byte buffer casted to a 1-byte buffer when calling wasmtime_trap_code. Users of the wasmtime crate are not affected by this issue, only users of the C API function wasmtime_trap_code are affected.

References

For more information

If you have any questions or comments about this advisory:

Impact

There is a bug in Wasmtime's C API implementation where the definition of the wasmtime_trap_code does not match its declared signature in the wasmtime/trap.h header file. This discrepancy causes the function implementation to perform a 4-byte write into a 1-byte buffer provided by the caller. This can lead to three zero bytes being written beyond the 1-byte location provided by the caller.

A write operation targets a memory location beyond the intended buffer boundary. Typical impact: memory corruption, crash, or arbitrary code execution.

CVE-2022-39394 has a CVSS score of 3.8 (Low). The vector is requires local access, high privileges required, and user interaction required. 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 (2.0.2, 1.0.2); upgrading removes the vulnerable code path.

Affected versions

wasmtime (>= 2.0.0, < 2.0.2) wasmtime (< 1.0.2)

Security releases

wasmtime → 2.0.2 (rust) wasmtime → 1.0.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 2.0.2.

Frequently Asked Questions

  1. What is CVE-2022-39394? CVE-2022-39394 is a low-severity out-of-bounds write vulnerability in wasmtime (rust), affecting versions >= 2.0.0, < 2.0.2. It is fixed in 2.0.2, 1.0.2. A write operation targets a memory location beyond the intended buffer boundary.
  2. How severe is CVE-2022-39394? CVE-2022-39394 has a CVSS score of 3.8 (Low). 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 versions of wasmtime are affected by CVE-2022-39394? wasmtime (rust) versions >= 2.0.0, < 2.0.2 is affected.
  4. Is there a fix for CVE-2022-39394? Yes. CVE-2022-39394 is fixed in 2.0.2, 1.0.2. Upgrade to this version or later.
  5. Is CVE-2022-39394 exploitable, and should I be worried? Whether CVE-2022-39394 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-39394 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-39394?
    • Upgrade wasmtime to 2.0.2 or later
    • Upgrade wasmtime to 1.0.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.