CVE-2024-47813
CVE-2024-47813 is a low-severity vulnerability in Bytecodealliance Wasmtime with a CVSS 3.x base score of 2.9. It is not currently listed as actively exploited by CISA, and its EPSS exploit-prediction score is low. The underlying weakness is classified as CWE-367.
Key facts
- Severity: Low (CVSS 3.x base score 2.9)
- EPSS exploit prediction: 0% (5th percentile)
- Actively exploited: Not listed in CISA KEV
- EU (EUVD) id: EUVD-2024-2985
- Weakness: CWE-367
- Affected product: Bytecodealliance Wasmtime
- Published:
- Last 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.
Frequently asked questions
- What is CVE-2024-47813?
- 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.
- How severe is CVE-2024-47813?
- CVE-2024-47813 has a CVSS 3.x base score of 2.9, rated low severity. It is exploitable over local access with high attack complexity, requires high privileges and user interaction. Impact on confidentiality is none, integrity low, and availability low.
- Is CVE-2024-47813 being actively exploited?
- It is not currently listed in CISA's KEV catalog. Its EPSS exploit-prediction score is 0% (5th percentile), an estimate of the probability of exploitation in the next 30 days.
- What products are affected by CVE-2024-47813?
- CVE-2024-47813 primarily affects Bytecodealliance Wasmtime. In total, 15 product configurations (CPEs) are listed as vulnerable; see the affected-products list for the exact versions.
- How do I fix CVE-2024-47813?
- Review the linked vendor and NVD advisories for patched versions and mitigations, then upgrade or apply the recommended workaround.
- Does CVE-2024-47813 have an EU (EUVD) identifier?
- Yes. CVE-2024-47813 is tracked in the ENISA EU Vulnerability Database (EUVD) as EUVD-2024-2985.
- When was CVE-2024-47813 published?
- CVE-2024-47813 was published on 2024-10-09 and last updated on 2026-06-17.
References
- https://github.com/bytecodealliance/wasmtime/pull/7969
- https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-7qmx-3fpx-r45m
Affected products (15)
- cpe:2.3:a:bytecodealliance:wasmtime:19.0.0:*:*:*:*:rust:*:*
- cpe:2.3:a:bytecodealliance:wasmtime:19.0.1:*:*:*:*:rust:*:*
- cpe:2.3:a:bytecodealliance:wasmtime:19.0.2:*:*:*:*:rust:*:*
- cpe:2.3:a:bytecodealliance:wasmtime:20.0.0:*:*:*:*:rust:*:*
- cpe:2.3:a:bytecodealliance:wasmtime:20.0.1:*:*:*:*:rust:*:*
- cpe:2.3:a:bytecodealliance:wasmtime:20.0.2:*:*:*:*:rust:*:*
- cpe:2.3:a:bytecodealliance:wasmtime:21.0.0:*:*:*:*:rust:*:*
- cpe:2.3:a:bytecodealliance:wasmtime:21.0.1:*:*:*:*:rust:*:*
- cpe:2.3:a:bytecodealliance:wasmtime:22.0.0:*:*:*:*:rust:*:*
- cpe:2.3:a:bytecodealliance:wasmtime:23.0.0:*:*:*:*:rust:*:*
- cpe:2.3:a:bytecodealliance:wasmtime:23.0.1:*:*:*:*:rust:*:*
- cpe:2.3:a:bytecodealliance:wasmtime:23.0.2:*:*:*:*:rust:*:*
- cpe:2.3:a:bytecodealliance:wasmtime:24.0.0:*:*:*:*:rust:*:*
- cpe:2.3:a:bytecodealliance:wasmtime:25.0.0:*:*:*:*:rust:*:*
- cpe:2.3:a:bytecodealliance:wasmtime:25.0.1:*:*:*:*:rust:*:*
More vulnerabilities in Bytecodealliance Wasmtime
- CVE-2024-51745 — Critical (CVSS 10.0): Wasmtime is a fast and secure runtime for WebAssembly. Wasmtime's filesystem sandbox implementation on Windows blocks…
- CVE-2026-34987 — Critical (CVSS 9.9): Wasmtime is a runtime for WebAssembly. From 25.0.0 to before 36.0.7, 42.0.2, and 43.0.1, Wasmtime with its Winch…
- CVE-2023-26489 — Critical (CVSS 9.9): wasmtime is a fast and secure runtime for WebAssembly. In affected versions wasmtime's code generator, Cranelift, has a…
- CVE-2022-39393 — High (CVSS 8.6): Wasmtime is a standalone runtime for WebAssembly. Prior to versions 2.0.2 and 1.0.2, there is a bug in Wasmtime's…
- CVE-2026-34941 — High (CVSS 8.1): Wasmtime is a runtime for WebAssembly. Prior to 24.0.7, 36.0.7, 42.0.2, and 43.0.1, Wasmtime contains a vulnerability…
- CVE-2022-24791 — High (CVSS 8.1): Wasmtime is a standalone JIT-style runtime for WebAssembly, using Cranelift. There is a use after free vulnerability in…
All CVEs affecting Bytecodealliance Wasmtime →
Other CWE-367 (Time-of-check Time-of-use (TOCTOU) Race Condition) vulnerabilities
- CVE-2026-25641 — Critical (CVSS 10.0): SandboxJS is a JavaScript sandboxing library. Prior to 0.8.29, there is a sandbox escape vulnerability due to a…
- CVE-2025-64180 — Critical (CVSS 10.0): Manager-io/Manager is accounting software. In Manager Desktop and Server versions 25.11.1.3085 and below, a critical…
- CVE-2025-34027 — Critical (CVSS 10.0): The Versa Concerto SD-WAN orchestration platform is vulnerable to an authentication bypass in the Traefik reverse proxy…
- CVE-2026-25052 — Critical (CVSS 9.9): n8n is an open source workflow automation platform. Prior to versions 1.123.18 and 2.5.0, a vulnerability in the file…
- CVE-2025-13032 — Critical (CVSS 9.9): Double fetch in sandbox kernel driver in Avast/AVG Antivirus <25.3 on windows allows local attacker to escalate…
- CVE-2026-53838 — Critical (CVSS 9.8): OpenClaw before 2026.5.27 contains a state mutation vulnerability in node pairing reconnection that allows paired nodes…
Browse all CWE-367 (Time-of-check Time-of-use (TOCTOU) Race Condition) vulnerabilities →