Wasmtime race condition could lead to WebAssembly control-flow integrity and type safety violations
Wasmtime is an open source runtime for WebAssembly. Under certain concurrent event orderings, a `wasmtime::Engine`'s internal type registry was susceptible to double-unregistration bugs due to a race condition, leading to panics and potentially type registry corruption. That registry corruption could, following an additional and particular sequence of concurrent events, lead to violations of WebAssembly's control-flow integrity (CFI) and type safety. Users that do not use `wasmtime::Engine` across multiple threads are not affected. Users that only create new modules across threads over time are additionally not affected. Reproducing this bug requires creating and dropping multiple type instances (such as `wasmtime::FuncType` or `wasmtime::ArrayType`) concurrently on multiple threads, where all types are associated with the same `wasmtime::Engine`. **Wasm guests cannot trigger this bug.** See the "References" section below for a list of Wasmtime types-related APIs that are affected. Wasmtime maintains an internal registry of types within a `wasmtime::Engine` and an engine is shareable across threads. Types can be created and referenced through creation of a `wasmtime::Module`, creation of `wasmtime::FuncType`, or a number of other APIs where the host creates a function (see "References" below). Each of these cases interacts with an engine to deduplicate type information and manage type indices that are used to implement type checks in WebAssembly's `call_indirect` function, for example. This bug is a race condition in this management where the internal type registry could be corrupted to trigger an assert or contain invalid state. Wasmtime's internal representation of a type has individual types (e.g. one-per-host-function) maintain a registration count of how many time it's been used. Types additionally have state within an engine behind a read-write lock such as lookup/deduplication information. The race here is a time-of-check versus time-of-use (TOCTOU) bug where one thread atomically decrements a type entry's registration count, observes zero registrations, and then acquires a lock in order to unregister that entry. However, between when this first thread observed the zero-registration count and when it acquires that lock, another thread could perform the following sequence of events: re-register another copy of the type, which deduplicates to that same entry, resurrecting it and incrementing its registration count; then drop the type and decrement its registration count; observe that the registration count is now zero; acquire the type registry lock; and finally unregister the type. Now, when the original thread finally acquires the lock and unregisters the entry, it is the second time this entry has been unregistered. This bug was originally introduced in Wasmtime 19's development of the WebAssembly GC proposal. This bug affects users who are not using the GC proposal, however, and affects Wasmtime in its default configuration even when the GC proposal is disabled. Wasmtime users using 19.0.0 and after are all affected by this issue. We have released the following Wasmtime versions, all of which have a fix for this bug: * 21.0.2 * 22.0.1 * 23.0.3 * 24.0.1 * 25.0.2. If your application creates and drops Wasmtime types on multiple threads concurrently, there are no known workarounds. Users are encouraged to upgrade to a patched release.
- Published
- Oct 9, 2024
- Updated
- Jun 17, 2026
- EPSS
- 0.2% · 4th percentile
- CWE
- CWE-367
Sign in to follow · You’ll be notified if a followed record enters KEV, gets an exploit or is updated.
Report tools
Action score
11
Monitor
Low priority for now.
- CVSS
- 11 / 40 · 2.9 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 0 / 30 · 0.2%
CISA SSVC decision
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
Vulnrichment: CISA's decision-tree inputs.
CNA vs NVD score
- NVD
- —
- CNA · GitHub_M
- 2.9
- NVD has not scored this yet; the score shown is the CNA’s.
The score given by the assigning authority versus NVD’s independent score. A gap means the severity is contested.
Noroxi analysis
No Noroxi analysis for this record yet
We don't hand-write analysis for the hundreds of thousands of vulnerabilities in the database; that wouldn't be honest. For notable, high-impact vulnerabilities our team writes the mechanism, detection and remediation steps.
We use this product, ask for helpAffected systems
| Vendor | Product | CPE |
|---|---|---|
| bytecodealliance | wasmtime | cpe:2.3:a:bytecodealliance:wasmtime |
Affected versions
NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.
- bytecodealliance wasmtime19.0.0
- bytecodealliance wasmtime19.0.1
- bytecodealliance wasmtime19.0.2
- bytecodealliance wasmtime20.0.0
- bytecodealliance wasmtime20.0.1
- bytecodealliance wasmtime20.0.2
- bytecodealliance wasmtime21.0.0
- bytecodealliance wasmtime21.0.1
- bytecodealliance wasmtime22.0.0
- bytecodealliance wasmtime23.0.0
- bytecodealliance wasmtime23.0.1
- bytecodealliance wasmtime23.0.2
- bytecodealliance wasmtime24.0.0
- bytecodealliance wasmtime25.0.0
- bytecodealliance wasmtime25.0.1
Versions reported by the vendor
Affected version ranges reported by the assigning authority (GitHub_M). Independent of NVD's CPE analysis and usually ahead of it.
bytecodealliance wasmtime
- >= 19.0.0, < 21.0.2, >= 22.0.0, < 22.0.1, >= 23.0.0, < 23.0.3, >= 24.0.0, < 24.0.1, >= 25.0.0, < 25.0.2affected
Package-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| crates.io | wasmtime | from 19.0.0 · before 21.0.2 | 21.0.2 |
| crates.io | wasmtime | from 22.0.0 · before 22.0.1 | 22.0.1 |
| crates.io | wasmtime | from 23.0.0 · before 23.0.3 | 23.0.3 |
| crates.io | wasmtime | from 24.0.0 · before 24.0.1 | 24.0.1 |
| crates.io | wasmtime | from 25.0.0 · before 25.0.2 | 25.0.2 |
| Debian:13 | rust-wasmtime | before 21.0.2+dfsg-1 | 21.0.2+dfsg-1 |
| PyPI | wasmtime | up to and including 21.0.0 | — |
| PyPI | wasmtime | up to and including 21.0.1 | — |
| PyPI | wasmtime | up to and including 22.0.0 | — |
| PyPI | wasmtime | up to and including 23.0.0 | — |
| PyPI | wasmtime | up to and including 19.0.0 | — |
| PyPI | wasmtime | up to and including 23.0.2 | — |
| PyPI | wasmtime | up to and including 24.0.0 | — |
| PyPI | wasmtime | up to and including 25.0.0 | — |
| PyPI | wasmtime | up to and including 25.0.1 | — |
| PyPI | wasmtime | up to and including 23.0.1 | — |
| PyPI | wasmtime | up to and including 19.0.1 | — |
| PyPI | wasmtime | up to and including 19.0.2 | — |
| PyPI | wasmtime | up to and including 20.0.0 | — |
| PyPI | wasmtime | up to and including 20.0.1 | — |
| PyPI | wasmtime | up to and including 20.0.2 | — |
Same product
bytecodealliance: all recordsOther highest-scoring records for the same primary product.
- CVE-2022-39394wasmtime_trap_code C API function has out of bounds write vulnerability39Monitor
- CVE-2022-24791Use after free in Wasmtime39Monitor
- CVE-2026-34987Wasmtime with Winch compiler backend on aarch64 may allow a sandbox-escaping memory access36Monitor
- CVE-2026-34971Wasmtime miscompiled guest heap access enables sandbox escape on aarch64 Cranelift36Monitor
- CVE-2023-30624Wasmtime has Undefined Behavior in Rust runtime functions35Monitor
- CVE-2022-39393Wasmtime vulnerable to data leakage between instances in the pooling allocator34Monitor
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| crates.io:wasmtime | 21.0.2 | Package registry (OSV) |
| crates.io:wasmtime | 22.0.1 | Package registry (OSV) |
| crates.io:wasmtime | 23.0.3 | Package registry (OSV) |
| crates.io:wasmtime | 24.0.1 | Package registry (OSV) |
| crates.io:wasmtime | 25.0.2 | Package registry (OSV) |
| debian:rust-wasmtime | 21.0.2+dfsg-1 · Debian:13 | Package registry (OSV) |
Exploit status
No known public exploit
No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
No dated events beyond publication.
FIRST EPSS daily score; only changes of 0.01 or more are recorded (step chart).
Patch and commit links
Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.
Credits
All researchersFinders, reporters and analysts named in the CNA record. Click a name for that researcher’s other records.
No credits in the CNA record.
Variant candidates
Same product, same weakness class, within 18 months. If the patch missed the root cause, the sibling bug is here.
No nightly-computed relations.
Chain candidates
An authentication bypass and a privilege-requiring bug in the same product, published close together: combined they may become an unauthenticated path.
—
Bug bounty scope
No known public program.
Source: bounty-targets-data (public HackerOne, Bugcrowd, Intigriti, YesWeHack listings).
Technical details
Attack conditions
- Someone with local access to the system can trigger it.
- Administrator privileges are required.
- A user must open a link or visit a page.
- Special conditions such as timing or configuration are required.
If successful
- Confidentiality
- none
- Integrity
- low · data or configuration can be modified
- Availability
- low · the service can be disrupted
- Attack vector
- Local
- Attack complexity
- High
- Privileges required
- High
- User interaction
- Required
- Scope
- Unchanged
- Confidentiality impact
- None
- Integrity impact
- Low
- Availability impact
- Low
Weakness class (CWE)
CWE-367 · Time-of-check Time-of-use (TOCTOU) Race ConditionCVSS vector
CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:N/I:L/A:L
nvd-secondary
Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
Change log
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
- github.com/bytecodealliance/wasmtime/pull/7969
- github.com/bytecodealliance/wasmtime/security/advisories/GHSA-7qmx-3fpx-r45m
Vendor advisories and official records. Exploit/PoC links are deliberately left out.