CVE-2022-24791
Use after free in Wasmtime
Also known as GHSA-gwc9-348x-qwv2, RUSTSEC-2022-0016, RUSTSEC-2022-0099
Mitigation
- Upgrade wasmtime to one of 0.34.2, 0.35.2 (or later in the same release line).
Who should check
- Projects that depend on crates.io package wasmtime (< 0.34.2)
- Anyone running bytecodealliance wasmtime < 0.34.2; >= 0.35.0, < 0.35.2
Vulnerability facts
- Affected
- wasmtime < 0.34.2
- Fixed in
- 0.34.2, 0.35.2
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Remote, no login needed
- CVSS
- 8.1 (v3.1, CNA)CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Network
- Attack complexity: High
- Privileges required: None
- User interaction: None
- Scope: Unchanged
- Confidentiality impact: High
- Integrity impact: High
- Availability impact: High
- EPSS
- 1.16% chance of exploitation in 30 days (percentile 67, 2026-11-26)
- CWE
- CWE-416
- Modified
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).
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| crates.io wasmtime | < 0.34.2 | 0.34.2, 0.35.2 | osv |
| bytecodealliance wasmtime | < 0.34.2; >= 0.35.0, < 0.35.2 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2022-24791. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2022-24791.md Affected: wasmtime < 0.34.2 Fixed in: 0.34.2, 0.35.2 Steps: 1. Search this machine and project for wasmtime (crates.io), bytecodealliance wasmtime: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
FAQ
Is CVE-2022-24791 being exploited?
There is no confirmed exploitation: CVE-2022-24791 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 1.16% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2022-24791?
High: CVSS 8.1 (v3.1, scored by CNA). Remote, no login needed. The attack needs conditions outside the attacker's control, which makes it harder.
Which versions are affected by CVE-2022-24791?
wasmtime < 0.34.2.
Is there a fix for CVE-2022-24791?
Yes. Fixed in 0.34.2, 0.35.2. Upgrade wasmtime to one of 0.34.2, 0.35.2 (or later in the same release line).
How do I check if I'm affected by CVE-2022-24791?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.