nday
CVE-2024-47813 GHSA-7qmx-3fpx-r45m

Wasmtime race condition could lead to WebAssembly control-flow integrity and type safety violations

bytecodealliance / wasmtime

Disclosed . nday has no fix record for it yet; that does not mean no patch exists. None of the four PoC sources lists it. Not in CISA KEV.

tags weakness typerace condition accesslocal
why these tags

nday derives these tags by fixed rules from the facts below; NVD, the CNA and other sources do not assign them. Vocabulary and rules: ~/tags.

race condition
CWE-367, stated by the CNA GitHub_M and NVD, republishing [email protected]
local
AV:L in CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:N/I:L/A:L (CVSS 3.1) from the CNA GitHub_M
stage
DIS
disclosed
cvss
2.9 LOW v3.1

Lifecycle

x axis UTC; dot = exact minute, wide bar = date only, hollow = unknown or inferred.
time unknown
DISdisclosed
2024-10-09T18:07Z
PATpatch
no record yet
ANAanalysis
no record yet
POCPoC
no record yet
ITWexploited
no record yet
KEVKEV
no record yet

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.

Original text of the CVE record (cvelist), shown as published.

Exploit conditions

What an attack needs, read from the CVSS vector.
Attack vector AV:L
Local: needs a local or SSH session, or a user tricked into acting on the machine
Attack complexity AC:H
High: success depends on conditions outside the attacker's control, such as gathering details of the target or winning a race
Privileges required PR:H
High: administrative or similar privileges
User interaction UI:R
Required: a user must do something, such as open a file or click a link

CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:N/I:L/A:L

CVSS 3.1 vector from the CVE record, scored by the CNA GitHub_M.

Event log

+DISdisclosed

CVE record published by GitHub_M. CVSS 2.9, low.

src cvelist · nday , bulk import · raw
{
  "id": 342362,
  "type": "disclosed",
  "source": "cvelist",
  "url": "https://www.cve.org/CVERecord?id=CVE-2024-47813",
  "occurred_at": "2024-10-09T18:07:49.686Z",
  "observed_at": "2026-11-13T05:38:40.555169Z",
  "is_backfill": true,
  "dedupe_key": "",
  "detail": {
    "cvss": {
      "source": "cna",
      "vector": "CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:N/I:L/A:L",
      "version": "3.1",
      "base_score": 2.9,
      "base_severity": "LOW"
    },
    "ssvc": {
      "timestamp": "2024-10-09T19:43:41.511742Z",
      "automatable": "no",
      "exploitation": "none",
      "technical_impact": "partial"
    },
    "state": "PUBLISHED",
    "date_published": "2024-10-09T18:07:49.686Z",
    "assigner_short_name": "GitHub_M"
  }
}

Report an error

report an error or omission

Something on this page wrong or missing? Tell the editors; if they accept it, this page's revision log says so publicly. Upstream data is not changed.

Researcher discussion

0 researchers mentioned this in the last 7 days

Posts on X by researchers on nday's list that mention this CVE, shown as posted. nday does not check them.

nday has not collected any post on X by listed researchers that mentions this CVE.

Discussion

0 comments

No comments yet.