CVE-2024-47813
Wasmtime race condition could lead to WebAssembly control-flow integrity and type safety violations
Also known as GHSA-7qmx-3fpx-r45m, PYSEC-2024-311, RUSTSEC-2024-0439
Mitigation
- Upgrade wasmtime to one of 21.0.2, 22.0.1, 23.0.3, 24.0.1, 25.0.2 (or later in the same release line).
Who should check
- Projects that depend on PyPI package wasmtime (<= 19.0.0; <= 19.0.1; <= 19.0.2; <= 20.0.0; <= 20.0.1; <= 20.0.2; <= 21.0.0; <= 21.0.1; <= 22.0.0; <= 23.0.0; <= 23.0.1; <= 23.0.2; <= 24.0.0; <= 25.0.0; <= 25.0.1)
- Projects that depend on crates.io package wasmtime (>= 19.0.0, < 21.0.2)
- Anyone running 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.2
Vulnerability facts
- Affected
- wasmtime <= 19.0.0; <= 19.0.1; <= 19.0.2; <= 20.0.0; <= 20.0.1; <= 20.0.2; <= 21.0.0; <= 21.0.1; <= 22.0.0; <= 23.0.0; <= 23.0.1; <= 23.0.2; <= 24.0.0; <= 25.0.0; <= 25.0.1; wasmtime >= 19.0.0, < 21.0.2
- Fixed in
- 21.0.2, 22.0.1, 23.0.3, 24.0.1, 25.0.2
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Not remotely exploitable (local or adjacent access needed)
- CVSS
- 2.9 (v3.1, CNA)CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:N/I:L/A:LOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Local
- Attack complexity: High
- Privileges required: High
- User interaction: Required
- Scope: Unchanged
- Confidentiality impact: None
- Integrity impact: Low
- Availability impact: Low
- EPSS
- 0.18% chance of exploitation in 30 days (percentile 5, 2026-11-26)
- CWE
- CWE-367
- Modified
Description
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.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| PyPI wasmtime | <= 19.0.0; <= 19.0.1; <= 19.0.2; <= 20.0.0; <= 20.0.1; <= 20.0.2; <= 21.0.0; <= 21.0.1; <= 22.0.0; <= 23.0.0; <= 23.0.1; <= 23.0.2; <= 24.0.0; <= 25.0.0; <= 25.0.1 | — | osv |
| crates.io wasmtime | >= 19.0.0, < 21.0.2 | 21.0.2, 22.0.1, 23.0.3, 24.0.1, 25.0.2 | osv |
| 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.2 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2024-47813. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2024-47813.md Affected: wasmtime <= 19.0.0; <= 19.0.1; <= 19.0.2; <= 20.0.0; <= 20.0.1; <= 20.0.2; <= 21.0.0; <= 21.0.1; <= 22.0.0; <= 23.0.0; <= 23.0.1; <= 23.0.2; <= 24.0.0; <= 25.0.0; <= 25.0.1; wasmtime >= 19.0.0, < 21.0.2 Fixed in: 21.0.2, 22.0.1, 23.0.3, 24.0.1, 25.0.2 Steps: 1. Search this machine and project for wasmtime (PyPI), wasmtime (crates.io), bytecodealliance wasmtime: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
Patches
FAQ
Is CVE-2024-47813 being exploited?
There is no confirmed exploitation: CVE-2024-47813 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.18% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2024-47813?
Low: CVSS 2.9 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed). A user has to take an action, such as opening a link, for the attack to work. The attack needs conditions outside the attacker's control, which makes it harder.
Which versions are affected by CVE-2024-47813?
wasmtime <= 19.0.0; <= 19.0.1; <= 19.0.2; <= 20.0.0; <= 20.0.1; <= 20.0.2; <= 21.0.0; <= 21.0.1; <= 22.0.0; <= 23.0.0; <= 23.0.1; <= 23.0.2; <= 24.0.0; <= 25.0.0; <= 25.0.1; wasmtime >= 19.0.0, < 21.0.2.
Is there a fix for CVE-2024-47813?
Yes. Fixed in 21.0.2, 22.0.1, 23.0.3, 24.0.1, 25.0.2. Upgrade wasmtime to one of 21.0.2, 22.0.1, 23.0.3, 24.0.1, 25.0.2 (or later in the same release line).
How do I check if I'm affected by CVE-2024-47813?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.