PT-2022-20562 · Wasmtime · Wasmtime

Alexcrichton

·

Published

2022-07-12

·

Updated

2022-07-27

·

CVE-2022-31146

CVSS v3.1

8.8

High

VectorAV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Name of the Vulnerable Software and Affected Versions Wasmtime versions 0.37.0 through 0.38.1
Description There is a bug in Wasmtime's code generator, Cranelift, where functions using reference types may be incorrectly missing metadata required for runtime garbage collection. This means that if a GC happens at runtime, the GC pass will mistakenly think these functions do not have live references to GC'd values, reclaiming them and deallocating them. The function will then subsequently continue to use the values assuming they had not been GC'd, leading later to a use-after-free. This bug was introduced in the migration to the regalloc2 register allocator that occurred in the Wasmtime 0.37.0 release.
Recommendations To resolve the issue, upgrade to Wasmtime version 0.38.2. As a temporary workaround, consider disabling the reference types proposal by passing false to wasmtime::Config::wasm reference types. Alternatively, downgrade to Wasmtime 0.36.0 or prior.

Exploit

Fix

Use After Free

Found an issue in the description? Have something to add? Feel free to write us 👾

Weakness Enumeration

Related Identifiers

CVE-2022-31146
GHSA-5FHJ-G3P3-PQ9G
RUSTSEC-2022-0100

Affected Products

Wasmtime