Wasmtime race condition could lead to WebAssembly control-flow integrity and type safety violations
Key facts
- Attack vector
- Local
- Privileges required
- High
- User interaction
- Required
- Attack complexity
- High
- Impact type
- —
- Confidentiality · integrity · availability
- None · Low · Low
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| bytecodealliance | wasmtime | 19.0.0 to before 21.0.2; 22.0.0 to before 22.0.1; 23.0.0 to before 23.0.3; 24.0.0 to before 24.0.1; 25.0.0 to before 25.0.2 | 21.0.2, 22.0.1, 23.0.3, 24.0.1, 25.0.2 | Patch available | CNA |
| — | wasmtime (crates.io) | 19.0.0 to before 21.0.2 | 21.0.2 | Patch available | GHSA-7qmx-3fpx-r45m |
| — | wasmtime (crates.io) | 22.0.0 to before 22.0.1 | 22.0.1 | Patch available | GHSA-7qmx-3fpx-r45m |
| — | wasmtime (crates.io) | 23.0.0 to before 23.0.3 | 23.0.3 | Patch available | GHSA-7qmx-3fpx-r45m |
| — | wasmtime (crates.io) | 24.0.0 to before 24.0.1 | 24.0.1 | Patch available | GHSA-7qmx-3fpx-r45m |
| — | wasmtime (crates.io) | 25.0.0 to before 25.0.2 | 25.0.2 | Patch available | GHSA-7qmx-3fpx-r45m |
- wasmtime Vendorbytecodealliance Affected 19.0.0 to before 21.0.2; 22.0.0 to before 22.0.1; 23.0.0 to before 23.0.3; 24.0.0 to before 24.0.1; 25.0.0 to before 25.0.2 Fixed in 21.0.2, 22.0.1, 23.0.3, 24.0.1, 25.0.2 Patch available CNA
- wasmtime (crates.io) Vendor— Affected 19.0.0 to before 21.0.2 Fixed in 21.0.2 Patch available GHSA-7qmx-3fpx-r45m
- wasmtime (crates.io) Vendor— Affected 22.0.0 to before 22.0.1 Fixed in 22.0.1 Patch available GHSA-7qmx-3fpx-r45m
- wasmtime (crates.io) Vendor— Affected 23.0.0 to before 23.0.3 Fixed in 23.0.3 Patch available GHSA-7qmx-3fpx-r45m
- wasmtime (crates.io) Vendor— Affected 24.0.0 to before 24.0.1 Fixed in 24.0.1 Patch available GHSA-7qmx-3fpx-r45m
- wasmtime (crates.io) Vendor— Affected 25.0.0 to before 25.0.2 Fixed in 25.0.2 Patch available GHSA-7qmx-3fpx-r45m
CPE configurations NVD · 15
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:bytecodealliance:wasmtime:19.0.0:*:*:*:*:rust:*:* | 19.0.0 | Vulnerable | bytecodealliance |
| cpe:2.3:a:bytecodealliance:wasmtime:19.0.1:*:*:*:*:rust:*:* | 19.0.1 | Vulnerable | bytecodealliance |
| cpe:2.3:a:bytecodealliance:wasmtime:19.0.2:*:*:*:*:rust:*:* | 19.0.2 | Vulnerable | bytecodealliance |
| cpe:2.3:a:bytecodealliance:wasmtime:20.0.0:*:*:*:*:rust:*:* | 20.0.0 | Vulnerable | bytecodealliance |
| cpe:2.3:a:bytecodealliance:wasmtime:20.0.1:*:*:*:*:rust:*:* | 20.0.1 | Vulnerable | bytecodealliance |
| cpe:2.3:a:bytecodealliance:wasmtime:20.0.2:*:*:*:*:rust:*:* | 20.0.2 | Vulnerable | bytecodealliance |
| cpe:2.3:a:bytecodealliance:wasmtime:21.0.0:*:*:*:*:rust:*:* | 21.0.0 | Vulnerable | bytecodealliance |
| cpe:2.3:a:bytecodealliance:wasmtime:21.0.1:*:*:*:*:rust:*:* | 21.0.1 | Vulnerable | bytecodealliance |
| cpe:2.3:a:bytecodealliance:wasmtime:22.0.0:*:*:*:*:rust:*:* | 22.0.0 | Vulnerable | bytecodealliance |
| cpe:2.3:a:bytecodealliance:wasmtime:23.0.0:*:*:*:*:rust:*:* | 23.0.0 | Vulnerable | bytecodealliance |
- cpe:2.3:a:bytecodealliance:wasmtime:19.0.0:*:*:*:*:rust:*:* Versions 19.0.0 Vulnerable ·bytecodealliance
- cpe:2.3:a:bytecodealliance:wasmtime:19.0.1:*:*:*:*:rust:*:* Versions 19.0.1 Vulnerable ·bytecodealliance
- cpe:2.3:a:bytecodealliance:wasmtime:19.0.2:*:*:*:*:rust:*:* Versions 19.0.2 Vulnerable ·bytecodealliance
- cpe:2.3:a:bytecodealliance:wasmtime:20.0.0:*:*:*:*:rust:*:* Versions 20.0.0 Vulnerable ·bytecodealliance
- cpe:2.3:a:bytecodealliance:wasmtime:20.0.1:*:*:*:*:rust:*:* Versions 20.0.1 Vulnerable ·bytecodealliance
- cpe:2.3:a:bytecodealliance:wasmtime:20.0.2:*:*:*:*:rust:*:* Versions 20.0.2 Vulnerable ·bytecodealliance
- cpe:2.3:a:bytecodealliance:wasmtime:21.0.0:*:*:*:*:rust:*:* Versions 21.0.0 Vulnerable ·bytecodealliance
- cpe:2.3:a:bytecodealliance:wasmtime:21.0.1:*:*:*:*:rust:*:* Versions 21.0.1 Vulnerable ·bytecodealliance
- cpe:2.3:a:bytecodealliance:wasmtime:22.0.0:*:*:*:*:rust:*:* Versions 22.0.0 Vulnerable ·bytecodealliance
- cpe:2.3:a:bytecodealliance:wasmtime:23.0.0:*:*:*:*:rust:*:* Versions 23.0.0 Vulnerable ·bytecodealliance
Show 5 more CPE
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:bytecodealliance:wasmtime:23.0.1:*:*:*:*:rust:*:* | 23.0.1 | Vulnerable | bytecodealliance |
| cpe:2.3:a:bytecodealliance:wasmtime:23.0.2:*:*:*:*:rust:*:* | 23.0.2 | Vulnerable | bytecodealliance |
| cpe:2.3:a:bytecodealliance:wasmtime:24.0.0:*:*:*:*:rust:*:* | 24.0.0 | Vulnerable | bytecodealliance |
| cpe:2.3:a:bytecodealliance:wasmtime:25.0.0:*:*:*:*:rust:*:* | 25.0.0 | Vulnerable | bytecodealliance |
| cpe:2.3:a:bytecodealliance:wasmtime:25.0.1:*:*:*:*:rust:*:* | 25.0.1 | Vulnerable | bytecodealliance |
- cpe:2.3:a:bytecodealliance:wasmtime:23.0.1:*:*:*:*:rust:*:* Versions 23.0.1 Vulnerable ·bytecodealliance
- cpe:2.3:a:bytecodealliance:wasmtime:23.0.2:*:*:*:*:rust:*:* Versions 23.0.2 Vulnerable ·bytecodealliance
- cpe:2.3:a:bytecodealliance:wasmtime:24.0.0:*:*:*:*:rust:*:* Versions 24.0.0 Vulnerable ·bytecodealliance
- cpe:2.3:a:bytecodealliance:wasmtime:25.0.0:*:*:*:*:rust:*:* Versions 25.0.0 Vulnerable ·bytecodealliance
- cpe:2.3:a:bytecodealliance:wasmtime:25.0.1:*:*:*:*:rust:*:* Versions 25.0.1 Vulnerable ·bytecodealliance
Remediation
- Fix · CNA wasmtime (bytecodealliance) Fixed in 21.0.2, 22.0.1, 23.0.3, 24.0.1, 25.0.2
- Fix · GHSA-7qmx-3fpx-r45m wasmtime (crates.io) Fixed in 21.0.2 Advisory →
- Fix · GHSA-7qmx-3fpx-r45m wasmtime (crates.io) Fixed in 22.0.1 Advisory →
- Fix · GHSA-7qmx-3fpx-r45m wasmtime (crates.io) Fixed in 23.0.3 Advisory →
- Fix · GHSA-7qmx-3fpx-r45m wasmtime (crates.io) Fixed in 24.0.1 Advisory →
- Fix · GHSA-7qmx-3fpx-r45m wasmtime (crates.io) Fixed in 25.0.2 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2024-47813
- 2026-10-03 Alias added: GHSA-7qmx-3fpx-r45m
References
Advisory 2
Other 5
- https://github.com/bytecodealliance/wasmtime/pull/7969
- https://github.com/bytecodealliance/wasmtime/commit/0ebe54d05f0e1f6c64b7c8bb48c9e9f6c95cacba
- https://github.com/bytecodealliance/wasmtime
- https://github.com/pypa/advisory-database/tree/main/vulns/wasmtime/PYSEC-2024-311.yaml
- https://rustsec.org/advisories/RUSTSEC-2024-0439.html
More bytecodealliance Wasmtime vulnerabilities
- TI-2026-21632 Wasmtime is vulnerable to panic when dropping a `[Typed]Func::call_async` future CVSS 4.0MEDIUM 6.9
- TI-2023-11636 Guest-controlled out-of-bounds read/write on x86_64 in wasmtime CVSS 3.1CRITICAL 10.0
- TI-2022-18765 Wasmtime vulnerable to data leakage between instances in the pooling allocator CVSS 3.1HIGH 8.6
- TI-2022-08604 Use after free in Wasmtime CVSS 3.1CRITICAL 9.8
- TI-2022-18766 wasmtime_trap_code C API function has out of bounds write vulnerability CVSS 3.1CRITICAL 9.8
- TI-2026-27209 Wasmtime with Winch compiler backend on aarch64 may allow a sandbox-escaping memory access CVSS 4.0CRITICAL 9.0
Sources
- CVE-2024-47813 · CVE Program
- CVE-2024-47813 · NVD
- FIRST EPSS
- GHSA-7qmx-3fpx-r45m · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences