9.8

CVE-2022-24791: bytecodealliance wasmtime Use After Free

CVSS: 9.8v3.1CriticalModified
AliasesUBUNTU-CVE-2022-24791openSUSE-SU-2024:12009-1GHSA-gwc9-348x-qwv2
Published 31-03-2022Last modified 23-04-2025

Vulnerability summary

CVE-2022-24791 is a critical (CVSS 9.8) Use After Free vulnerability in bytecodealliance wasmtime. EPSS estimates a 1.18% chance of exploitation in the next 30 days, higher than 67.2% of scored vulnerabilities.

Overall risk
70/100
0100
High · default modelHow is this calculated?
CVSS score
9.8/10
010
Critical · v3.1 (NVD)
EPSS score
1.18%
0%100%
Low · 0.00 pp in 30 days
KEVNot listedIn no KEV catalog
RansomwareNone recordedNo known use recorded
Public exploits0No public exploits recorded

Timeline

  1. 31-03-2022
    PublishedVulnerability first disclosed.
  2. 23-04-2025
    Last modifiedVulnerability information updated.

Description

Wasmtime is a standalone JIT-style runtime for WebAssembly, using Cranelift. There is a use after free vulnerability in Wasmtime when both running Wasm that uses externrefs and enabling epoch interruption in Wasmtime. If you are not explicitly enabling epoch interruption (it is disabled by default) then you are not affected. If you are explicitly disabling the Wasm reference types proposal (it is enabled by default) then you are also not affected. The use after free is caused by Cranelift failing to emit stack maps when there are safepoints inside cold blocks. Cold blocks occur when epoch interruption is enabled. Cold blocks are emitted at the end of compiled functions, and change the order blocks are emitted versus defined. This reordering accidentally caused Cranelift to skip emitting some stack maps because it expected to emit the stack maps in block definition order, rather than block emission order. When Wasmtime would eventually collect garbage, it would fail to find live references on the stack because of the missing stack maps, think that they were unreferenced garbage, and therefore reclaim them. Then after the collection ended, the Wasm code could use the reclaimed-too-early references, which is a use after free. Patches have been released in versions 0.34.2 and 0.35.2, which fix the vulnerability. All Wasmtime users are recommended to upgrade to these patched versions. If upgrading is not an option for you at this time, you can avoid the vulnerability by either: disabling the Wasm reference types proposal, config.wasm_reference_types(false); or by disabling epoch interruption if you were previously enabling it. config.epoch_interruption(false).

CVSS metrics

5 scores · 4 sources · 2 versions

EPSS trend

Probability

1.18%

Chance of exploitation in the next 30 days

Percentile

67%

Versus all other CVEs

30-day change

0.00 pp

From 1.18% on 20-09-2026

20-09-202620-10-2026
EPSS score
1.18%

Known exploited

Compare KEV catalogs

Not in any of the 3 tracked catalogs.

Public exploits

0 found

No public exploits indexed.

Weaknesses

CWE · root cause

Affected systems

Ubuntu7 products
  • firefox< 1:1snap1-0ubuntu1
  • mozjs38All versions (No fix recorded)
  • mozjs52All versions (No fix recorded)
  • mozjs68All versions (No fix recorded)
  • mozjs78All versions (No fix recorded)
Bytecodealliance1 product
  • wasmtime< 0.34.2 | ≥ 0.34.0, < 0.34.2 | ≥ 0.35.0, < 0.35.2
Crates.Io1 product
  • wasmtime< 0.34.2 | ≥ 0.35.0, < 0.35.2
Opensuse1 product
  • cargo-audit-advisory-db&distro=openSUSE Tumbleweed< 20220420-1.1

4 vendors · 10 products

References

12 links
Show all 12 references