BREACHSPIDER
CVE databaseVendorsIntelFeaturesDevelopersDocsPricingSign inStart free trial

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

Medium 6.3

Wasmtime is an open source runtime for WebAssembly & WASI. In Wasmtime from version 0.26.0 and before version 0.30.0 is affected by a memory unsoundness vulnerability. There was an invalid free and out-of-bounds read and write bug when running Wasm that uses `externref`s in Wasmtime. To trigger this bug, Wasmtime ne...

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

CVSS 3.16.3
EPSS0.3%
EPSS percentile15th
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.26.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.26.0 and before version 0.30.0 is affected by a memory unsoundness vulnerability. There was an invalid free and out-of-bounds read and write bug when running Wasm that uses `externref`s in Wasmtime. To trigger this bug, Wasmtime needs to be running Wasm that uses `externref`s, the host creates non-null `externrefs`, Wasmtime performs a garbage collection (GC), and there has to be a Wasm frame on the stack that is at a GC safepoint where there are no live references at this safepoint, and there is a safepoint with live references earlier in this frame's function. Under this scenario, Wasmtime would incorrectly use the GC stack map for the safepoint from earlier in the function instead of the empty safepoint. This would result in Wasmtime treating arbitrary stack slots as `externref`s that needed to be rooted for GC. At the *next* GC, it would be determined that nothing was referencing these bogus `externref`s (because nothing could ever reference them, because they are not really `externref`s) and then Wasmtime would deallocate them and run `<ExternRef as Drop>::drop` on them. This results in a free of memory that is not necessarily on the heap (and shouldn't be freed at this moment even if it was), as well as potential out-of-bounds reads and writes. Even though support for `externref`s (via the reference types proposal) is enabled by default, unless you are creating non-null `externref`s in your host code or explicitly triggering GCs, you cannot be affected by this bug. We have reason to believe that the effective impact of this bug is relatively small because usage of `externref` is currently quite rare. This bug has been patched and users should upgrade to Wasmtime version 0.30.0. If you cannot upgrade Wasmtime at this time, you can avoid this bug by disabling the reference types proposal by passing `false` to `wasmtime::Config::wasm_reference_types`.

Source: NIST NVD / MITRE CVE.

Record details

CVE IDCVE-2021-39218
BreachSpider IDBS-2021-GLOBAL-074658-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-125: Out-of-Bounds Read

Software reads data past the boundary of an allocated buffer, leaking sensitive information or causing crashes.

CWE-590: CWE-590

CWE-787: Out-of-Bounds Write

Software writes data past buffer boundaries, corrupting memory and potentially enabling code execution.

Related attack patterns (CAPEC)

CAPEC-540 Overread Buffers via CWE-125

Mapping is CWE to CAPEC per MITRE CAPEC 3.9.

Analysis AI-written, not human-reviewed

Wasmtime versions 0.26.0 to 0.29.9 are affected by a memory unsoundness vulnerability due to an invalid free and out-of-bounds read and write bug when handling `externref` in WebAssembly.

An attacker can exploit this vulnerability by crafting malicious WebAssembly code that uses `externref` types, which can lead to arbitrary code execution or denial of service when executed in an affected version of Wasmtime.

Questions

What is CVE-2021-39218?

Wasmtime versions 0.26.0 to 0.29.9 are affected by a memory unsoundness vulnerability due to an invalid free and out-of-bounds read and write bug when handling `externref` in WebAssembly.

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

CVE-2021-39218 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-39218 actively exploited?

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

How do I remediate CVE-2021-39218?

Priority: HIGH.

What systems are affected by CVE-2021-39218?

CVE-2021-39218 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.