cve.bz

CVE-2022-24791 bytecodealliance wasmtime: Use After Free

9.8 criticalEPSS 1.2%Fix available

Critical (9.8) in bytecodealliance wasmtime. EPSS 1.2% estimated probability of exploitation activity in the next 30 days. Fixed in wasmtime 0.34.2, 0.35.2.

On this page
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).

Severity

CVSS 3.1

9.8 critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS
1.2% (unchanged from 1.2% a week ago; 1.2% 30 days ago) estimated probability of exploitation activity in the next 30 days; 68th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: total, assessed 2025-04-23. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-416 Use After Free
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2022-24791 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2022-24791?via=ask-ai-copy and https://cve.bz/cve/CVE-2022-24791?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2022-24791 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
bytecodealliance:wasmtimefrom 0.34.0 before 0.34.2
bytecodealliance:wasmtimefrom 0.35.0 before 0.35.2

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-gwc9-348x-qwv2crates.iowasmtime<0.34.20.34.2
GHSA-gwc9-348x-qwv2crates.iowasmtime>=0.35.0 <0.35.20.35.2
RUSTSEC-2022-0016crates.iowasmtime>=0.34.0 <0.34.2
>=0.35.0 <0.35.2
0.34.2, 0.35.2
RUSTSEC-2022-0099crates.iowasmtime>=0.0.0-0 <0.34.2
>=0.35.0 <0.35.2
0.34.2, 0.35.2

Linux distributions

DistributionReleasePackageFixed inAdvisory
Ubuntu18.04:LTSmozjs38, mozjs52no fix listedUBUNTU-CVE-2022-24791
Ubuntu20.04:LTSmozjs52, mozjs68no fix listedUBUNTU-CVE-2022-24791
Ubuntu22.04:LTSfirefox1:1snap1-0ubuntu1UBUNTU-CVE-2022-24791
Ubuntu22.04:LTSmozjs78, mozjs91, thunderbirdno fix listedUBUNTU-CVE-2022-24791
Ubuntu24.04:LTSthunderbirdno fix listedUBUNTU-CVE-2022-24791
openSUSETumbleweedcargo-audit-advisory-db20220420-1.1openSUSE-SU-2024:12009-1

From the distributions' data via OSV.dev: Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; SUSE security data, CC BY 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Ubuntu · openSUSE.

References

Check your stackJSON