{"answers":{"affected":"12 open source packages ship an affected version, including wasmtime. It affects 1 product.","exploited":"There is no known exploitation of CVE-2024-47813 in the wild and no public exploit code.","fix":"Upgrade wasmtime to a fixed version for your release line: 21.0.2, 22.0.1, 23.0.3 or 24.0.1.","what":"CVE-2024-47813 is a low-severity vulnerability in bytecodealliance wasmtime, published on 9 Oct 2024. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2024-47813 and fix it if it is affected.\n\nWhat it is: CVE-2024-47813 is a low-severity vulnerability in bytecodealliance wasmtime, published on 9 Oct 2024. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of CVE-2024-47813 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- wasmtime (PyPI): affected all versions up to 19.0.0; no fix listed\n- wasmtime (crates.io): affected from 19.0.0; fixed in 21.0.2, 22.0.1, 23.0.3, 24.0.1, 25.0.2\n- wasmtime (crates.io): affected from 19.0.0; fixed in 21.0.2\n- wasmtime (crates.io): affected from 19.0.0; fixed in 21.0.2\n- wasmtime (crates.io): affected from 22.0.0; fixed in 22.0.1\n- wasmtime (crates.io): affected from 22.0.0; fixed in 22.0.1\n- wasmtime (crates.io): affected from 23.0.0; fixed in 23.0.3\n- wasmtime (crates.io): affected from 23.0.0; fixed in 23.0.3\n- wasmtime (crates.io): affected from 24.0.0; fixed in 24.0.1\n- wasmtime (crates.io): affected from 24.0.0; fixed in 24.0.1\n- wasmtime (crates.io): affected from 25.0.0; fixed in 25.0.2\n- wasmtime (crates.io): affected from 25.0.0; fixed in 25.0.2\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2024-47813/ (Markdown: https://insights.sbomify.com/CVE-2024-47813/index.md)","id":"CVE-2024-47813","markdown":"https://insights.sbomify.com/CVE-2024-47813/index.md","name":"CVE-2024-47813","record":{"aliases":["DEBIAN-CVE-2024-47813","GHSA-7qmx-3fpx-r45m","PYSEC-2024-311","RUSTSEC-2024-0439","UBUNTU-CVE-2024-47813"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution","denial_of_service"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"WebAssembly runtime library","requires_auth":"high_privilege","summary":"A race condition in Wasmtime's type registry can lead to memory corruption, allowing attackers to violate type safety and potentially execute arbitrary code.","user_interaction":"required","vuln_class":"race_condition"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"wasmtime","vendor":"bytecodealliance"}],"cvss":{"score":2.9,"severity":"low","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"},"cwes":[{"id":"CWE-367","name":"Time-of-check Time-of-use (TOCTOU) Race Condition"}],"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.","ecosystems":["PyPI","crates.io"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Wasmtime race condition could lead to WebAssembly control-flow integrity and type safety violations","id":"CVE-2024-47813","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"race_condition","year":"2024"},"n_packages":12,"n_references":2,"next":{"headline":"use-after-free when closing buffers in Vim","id":"CVE-2024-47814"},"packages":[{"ecosystem":"PyPI","fixed":[],"introduced":["0"],"last_affected":["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"],"package":"wasmtime","purl":"pkg:pypi/wasmtime","source":"PYSEC-2024-311"},{"ecosystem":"crates.io","fixed":["21.0.2","22.0.1","23.0.3","24.0.1","25.0.2"],"introduced":["19.0.0","22.0.0","23.0.0","24.0.0","25.0.0"],"last_affected":[],"package":"wasmtime","purl":"pkg:cargo/wasmtime","source":"RUSTSEC-2024-0439"},{"ecosystem":"crates.io","fixed":["21.0.2"],"introduced":["19.0.0"],"last_affected":[],"package":"wasmtime","purl":null,"source":"GHSA-7qmx-3fpx-r45m"},{"ecosystem":"crates.io","fixed":["21.0.2"],"introduced":["19.0.0"],"last_affected":[],"package":"wasmtime","purl":"pkg:cargo/wasmtime","source":"GHSA-7qmx-3fpx-r45m"},{"ecosystem":"crates.io","fixed":["22.0.1"],"introduced":["22.0.0"],"last_affected":[],"package":"wasmtime","purl":null,"source":"GHSA-7qmx-3fpx-r45m"},{"ecosystem":"crates.io","fixed":["22.0.1"],"introduced":["22.0.0"],"last_affected":[],"package":"wasmtime","purl":"pkg:cargo/wasmtime","source":"GHSA-7qmx-3fpx-r45m"},{"ecosystem":"crates.io","fixed":["23.0.3"],"introduced":["23.0.0"],"last_affected":[],"package":"wasmtime","purl":null,"source":"GHSA-7qmx-3fpx-r45m"},{"ecosystem":"crates.io","fixed":["23.0.3"],"introduced":["23.0.0"],"last_affected":[],"package":"wasmtime","purl":"pkg:cargo/wasmtime","source":"GHSA-7qmx-3fpx-r45m"},{"ecosystem":"crates.io","fixed":["24.0.1"],"introduced":["24.0.0"],"last_affected":[],"package":"wasmtime","purl":null,"source":"GHSA-7qmx-3fpx-r45m"},{"ecosystem":"crates.io","fixed":["24.0.1"],"introduced":["24.0.0"],"last_affected":[],"package":"wasmtime","purl":"pkg:cargo/wasmtime","source":"GHSA-7qmx-3fpx-r45m"},{"ecosystem":"crates.io","fixed":["25.0.2"],"introduced":["25.0.0"],"last_affected":[],"package":"wasmtime","purl":null,"source":"GHSA-7qmx-3fpx-r45m"},{"ecosystem":"crates.io","fixed":["25.0.2"],"introduced":["25.0.0"],"last_affected":[],"package":"wasmtime","purl":"pkg:cargo/wasmtime","source":"GHSA-7qmx-3fpx-r45m"}],"prev":{"headline":"Cross-site Scripting (XSS) on Special:RequestImportQueue when displaying request date in ImportDump","id":"CVE-2024-47812"},"products":["wasmtime"],"published":"2024-10-09","related":[{"cvss_score":9,"headline":"Wasmtime miscompiled guest heap access enables sandbox escape on aarch64 Cranelift","id":"CVE-2026-34971","kev_date_added":null,"published":"2026-04-09"},{"cvss_score":9,"headline":"Wasmtime with Winch compiler backend on aarch64 may allow a sandbox-escaping memory access","id":"CVE-2026-34987","kev_date_added":null,"published":"2026-04-09"},{"cvss_score":8.6,"headline":"Wasmtime vulnerable to data leakage between instances in the pooling allocator","id":"CVE-2022-39393","kev_date_added":null,"published":"2022-11-10"},{"cvss_score":8.1,"headline":"Use after free in Wasmtime","id":"CVE-2022-24791","kev_date_added":null,"published":"2022-03-31"},{"cvss_score":7.5,"headline":"Wasmtime: WASI path_open(TRUNCATE) bypasses `FilePerms::WRITE` host restriction","id":"CVE-2026-47261","kev_date_added":null,"published":"2026-06-15"},{"cvss_score":6.9,"headline":"Wasmtime has a Heap OOB read in component model UTF-16 to latin1+utf16 string transcoding","id":"CVE-2026-34941","kev_date_added":null,"published":"2026-04-09"},{"cvss_score":6.9,"headline":"Wasmtime is vulnerable to panic when dropping a `[Typed]Func::call_async` future","id":"CVE-2026-27195","kev_date_added":null,"published":"2026-02-24"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"open","licence":"CC0 1.0","name":"RustSec","prefix":"RUSTSEC"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2024-10-09","vendors":["bytecodealliance"]},"summary":"A race condition in Wasmtime's type registry can lead to memory corruption, allowing attackers to violate type safety and potentially execute arbitrary code.","url":"https://insights.sbomify.com/CVE-2024-47813/"}