CVE-2022-24791
published high CVSS 3.1 · 8.1Use after free in Wasmtime
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| bytecodealliance | — | wasmtime< 0.34.2 · >= 0.35.0, < 0.35.2 | Affected | Not stated | GitHub_M |
| SUSE / openSUSE | openSUSE-Tumbleweed | cargo-audit-advisory-dbaarch64 | Advisory build | 20220420-1.1 | OPENSUSE-SU-2024:12009-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | cargo-audit-advisory-dbppc64le | Advisory build | 20220420-1.1 | OPENSUSE-SU-2024:12009-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | cargo-audit-advisory-dbs390x | Advisory build | 20220420-1.1 | OPENSUSE-SU-2024:12009-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | cargo-audit-advisory-dbx86_64 | Advisory build | 20220420-1.1 | OPENSUSE-SU-2024:12009-1 |
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).
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 8.1 / 10
- Severity
- high
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| bytecodealliance | wasmtime | < 0.34.2 (affected)>= 0.35.0, < 0.35.2 (affected) | GitHub_M · cna |
Weaknesses
1- CWE-416 CWE-416: Use After Free
References
2Provider assertions
3GitHub_M · cna
Use after free in Wasmtime
CISA-ADP · adp
CISA ADP Vulnrichment
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.1
- Searchable
- yes
- Content hash
- aae358f4fc171ce26daee3380275a1d3b55ec37d01cb152190b1ab7a32aad26a
- Ingested
- 23 Sep 2026, 07:58:57 UTC
- Source record
- Official CVE record