9.8

CVE-2022-24791: Use after free in Wasmtime

Modified
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 68.6% of scored vulnerabilities.

Priority
Prioritisesevere

Severe, CVSS 8.1 (CVE.org); no exploitation reported by the 5 checked sources; EPSS 1% (FIRST, 04-12-2026)

Source freshness unavailable

How is this decided?
CVSS score
9.8/10
010
Critical · v3.1 (NVD)
EPSS score
1.18%
0%100%
Low · 0.00 pp in 30 days
KEVNot listedNot listed by any tracked catalog.
RansomwareNot flaggedNo ransomware 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

69%

Versus all other CVEs

30-day change

No change 0.00 pp

From 1.18% on 04-11-2026

04-11-202604-12-2026

Known exploited

Compare KEV catalogs
CISA KEV

Not in the CISA KEV catalog.

ENISA CNW

Not in the ENISA CNW catalog.

CIRCL

Not in the CIRCL catalog.

Public exploits

0 found

No public exploits indexed.

Weaknesses

CWE · root cause

Affected systems

Version check

Known conditions: network-reachable, no authentication, no user interaction (CVSS vector). Other conditions: not stated in public data.

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