BREACHSPIDER
CVE databaseVendorsIntelFeaturesDevelopersDocsPricingSign inStart free trial

CVE-2021-39216 in Bytecodealliance Wasmtime and 1 more product

Medium 6.3

Wasmtime is an open source runtime for WebAssembly & WASI. In Wasmtime from version 0.19.0 and before version 0.30.0 there was a use-after-free bug when passing `externref`s from the host to guest Wasm content. To trigger the bug, you have to explicitly pass multiple `externref`s from the host to a Wasm instance at ...

Affects 2 products from 2 vendors. Facts below cite their sources.

CVSS 3.16.3
EPSS0.3%
EPSS percentile16th
FixUnknown

Requires local access, high complexity, low privileges required, no user interaction needed, impact contained to the vulnerable component, no confidentiality impact, full integrity impact, full availability impact.

Affected products and versions

VendorProductAffected versions
Bytecodealliance Wasmtime ≥ 0.19.0, < 0.30.0
Fedoraproject Fedora 34 35

A product listed here is affected only at the versions shown. Use the free check to test the exact version you run.

Fix and vendor advisory

No official vendor advisory link on record. See the CVE record.

Exploitation

CISA known-exploitedNot in the CISA KEV catalog
Public exploitNot confirmed

Official description

Wasmtime is an open source runtime for WebAssembly & WASI. In Wasmtime from version 0.19.0 and before version 0.30.0 there was a use-after-free bug when passing `externref`s from the host to guest Wasm content. To trigger the bug, you have to explicitly pass multiple `externref`s from the host to a Wasm instance at the same time, either by passing multiple `externref`s as arguments from host code to a Wasm function, or returning multiple `externref`s to Wasm from a multi-value return function defined in the host. If you do not have host code that matches one of these shapes, then you are not impacted. If Wasmtime's `VMExternRefActivationsTable` became filled to capacity after passing the first `externref` in, then passing in the second `externref` could trigger a garbage collection. However the first `externref` is not rooted until we pass control to Wasm, and therefore could be reclaimed by the collector if nothing else was holding a reference to it or otherwise keeping it alive. Then, when control was passed to Wasm after the garbage collection, Wasm could use the first `externref`, which at this point has already been freed. We have reason to believe that the effective impact of this bug is relatively small because usage of `externref` is currently quite rare. The bug has been fixed, and users should upgrade to Wasmtime 0.30.0. If you cannot upgrade Wasmtime yet, you can avoid the bug by disabling reference types support in Wasmtime by passing `false` to `wasmtime::Config::wasm_reference_types`.

Source: NIST NVD / MITRE CVE.

Record details

CVE IDCVE-2021-39216
BreachSpider IDBS-2021-GLOBAL-073524-M
CVSS vectorCVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:H
Published2021-09-17
Last modified2026-06-17
Weakness (CWE)
SourceNVD

Weakness definitions

CWE-416: Use After Free

Software references memory after it has been freed, leading to corruption, crashes, or code execution.

Analysis AI-written, not human-reviewed

A use-after-free vulnerability exists in Wasmtime versions 0.19.0 to 0.29.9, affecting the handling of `externref` values passed from the host to guest Wasm content. This could potentially allow an attacker to execute arbitrary code or cause a denial of service.

The vulnerability can be exploited by passing multiple `externref` values from the host to a Wasm instance simultaneously, either as arguments or through other means of interaction. This requires precise control over the interaction between the host and the Wasm instance.

Questions

What is CVE-2021-39216?

A use-after-free vulnerability exists in Wasmtime versions 0.19.0 to 0.29.9, affecting the handling of `externref` values passed from the host to guest Wasm content. This could potentially allow an attacker to execute arbitrary code or cause a denial of service.

What is the CVSS score for CVE-2021-39216?

CVE-2021-39216 has CVSS 6.3 (Medium). Vector: CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:H. EPSS: 0.3%.

Is CVE-2021-39216 actively exploited?

No confirmed active exploitation of CVE-2021-39216 as of 2026-09-25.

How do I remediate CVE-2021-39216?

Priority: HIGH.

What systems are affected by CVE-2021-39216?

CVE-2021-39216 affects Bytecodealliance Wasmtime; Fedoraproject Fedora.

For developers and AI agents

Run this check from your own code or agent

REST API

curl -s https://breachspider.com/api/v1/assets/correlate-cves \
 -H "Authorization: Bearer $BREACHSPIDER_API_KEY" \
 -H "Content-Type: application/json" \
 -d '{"assets":[{"asset_id":"dev-1","vendor":"Bytecodealliance","product":"Wasmtime","version":"1.0"}]}'

API reference

Python SDK

pip install breachspider

PyPI · GitHub

MCP for AI agents

# hosted: add as a connector
https://mcp.breachspider.com/mcp
# local
pipx install breachspider-mcp

Setup for Claude, ChatGPT, Cursor

Free trial: 14 days, 750 device checks, no card.

Page facts from NVD, MITRE, CISA and vendor advisories, record last modified 2026-06-17.