CVE-2022-31146

Use After Free in Wasmtime

HIGH
8.8
CVSS Score
Published: July 20, 2022 at 10:30 PM UTC
Updated: June 17, 2026 at 04:44 AM UTC
2 products affected across 1 vendorWasmtimeCranelift Codegen

Using wasmtime by bytecodealliance?

Get instant alerts when new vulnerabilities affect wasmtime - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH8.8
Exploit prediction
EPSS 1%
SSVC
No known exploit

Description

Wasmtime is a standalone runtime for WebAssembly. There is a bug in the 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 then 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 on 2022-05-20. This bug has been patched and users should upgrade to Wasmtime version 0.38.2. Mitigations for this issue can be achieved by disabling the reference types proposal by passing `false` to `wasmtime::Config::wasm_reference_types` or downgrading to Wasmtime 0.36.0 or prior.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

0.84.0 ≤ v < 0.85.2
Affected range stops below 0.85.2, so it looks safe — our inference, not a vendor statement
v < 0.38.2v < 0.85.20.37.0 ≤ v < 0.38.2
Affected range stops below 0.38.2, so it looks safe — our inference, not a vendor statement
Affected range stops below 0.85.2, so it looks safe — our inference, not a vendor statement

Remediation

No guide yet

No remediation guidance has been written for this CVE yet. What the record does show:

References (3)

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
NETWORK
Complexity
LOW
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
HIGH
Availability
HIGH
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-416

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card