CVE-2022-24791

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).
ProviderTypeBase ScoreAtk. VectorAtk. ComplexityPriv. RequiredVector
NISTNIST
8.1 HIGH
NETWORK
HIGH
NONE
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
GitHub_MCNA
8.1 HIGH
NETWORK
HIGH
NONE
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
CVEADP
---
---
CISA-ADPADP
---
---
Base Score
CVSS 3.x
EPSS Score
Percentile: 58%
VendorProductVersion
bytecodealliancewasmtime
0.34.0 ≤
𝑥
< 0.34.2
bytecodealliancewasmtime
0.35.0 ≤
𝑥
< 0.35.2
𝑥
= Vulnerable software versions
Ubuntu logo
Ubuntu Releases
Ubuntu Product
Codename
firefox
noble
Fixed 1:1snap1-0ubuntu1
released
mantic
Fixed 1:1snap1-0ubuntu1
released
lunar
Fixed 1:1snap1-0ubuntu1
released
kinetic
Fixed 1:1snap1-0ubuntu1
released
jammy
Fixed 1:1snap1-0ubuntu1
released
impish
ignored
focal
ignored
bionic
ignored
xenial
ignored
trusty
dne
mozjs38
noble
dne
mantic
dne
lunar
dne
kinetic
dne
jammy
dne
impish
dne
focal
dne
bionic
ignored
xenial
dne
trusty
dne
mozjs52
noble
dne
mantic
dne
lunar
dne
kinetic
dne
jammy
dne
impish
dne
focal
ignored
bionic
ignored
xenial
dne
trusty
dne
mozjs68
noble
dne
mantic
dne
lunar
dne
kinetic
dne
jammy
dne
impish
dne
focal
ignored
bionic
dne
xenial
dne
trusty
dne
mozjs78
noble
dne
mantic
dne
lunar
ignored
kinetic
ignored
jammy
ignored
impish
ignored
focal
dne
bionic
dne
xenial
dne
trusty
dne
mozjs91
noble
dne
mantic
dne
lunar
dne
kinetic
dne
jammy
ignored
impish
dne
focal
dne
bionic
dne
xenial
dne
trusty
dne
thunderbird
noble
ignored
mantic
ignored
lunar
ignored
kinetic
ignored
jammy
ignored
impish
ignored
focal
ignored
bionic
ignored
xenial
ignored
trusty
dne