# CVE-2024-47813: Bytecode Alliance Wasmtime race condition in internal type registry

Source: https://junglewise.ai/threats/cve-2024-47813-bytecode-alliance-wasmtime-race-condition-in-internal-type  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2024-10-09. Updated: 2026-06-08  
License: CC BY 4.0 with a link back

CVE-2024-47813 · Severity: low · CVSS 3.1 · Published 2024-10-09

Wasmtime is a runtime used to execute WebAssembly code safely. A race condition in how it manages internal data types could allow a malicious or malfunctioning application to bypass security checks. This could lead to program crashes or the execution of code with incorrect data types, potentially compromising the integrity of the application's operations.

Technologies: [wasmtime (crates.io)](https://junglewise.ai/threats/technologies/wasmtime), [wasmtime (PyPI)](https://junglewise.ai/threats/technologies/pypi-wasmtime). Vendors: [crates.io](https://junglewise.ai/threats/vendors/crates-io), [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2024-47813 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2024-47813 being exploited in the wild.

**How severe is CVE-2024-47813?** Low severity, with a CVSS score of 3.1, published 9 October 2024.

**Which products and versions are affected?** wasmtime (crates.io) SEMVER:introduced=19.0.0,fixed=21.0.2, SEMVER:introduced=19.0.0,fixed=21.0.2,introduced=22.0.0,fixed=22.0.1,introduced=23.0.0,fixed=23.0.3,introduced=24.0.0,fixed=24.0.1,introduced=25.0.0,fixed=25.0.2; wasmtime (PyPI) ECOSYSTEM:introduced=0,last_affected=19.0.0,last_affected=19.0.1,last_affected=19.0.2,last_affected=20.0.0,last_affected=20.0.1,last_affected=20.0.2,last_affected=21.0.0,last_affected=21.0.1,last_affected=22.0.0,last_affected=23.0.0,last_affected=23.0.1,last_affected=23.0.2,last_affected=24.0.0,last_affected=25.0.0,last_affected=25.0.1.

**Is there a fix for CVE-2024-47813?** Yes. wasmtime (crates.io): upgrade to 21.0.2, 25.0.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2024-47813 attacked?** It is attacked with local access, in a software library.

**Am I affected by CVE-2024-47813?** Check whether you run wasmtime (crates.io) or wasmtime (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- wasmtime (crates.io): upgrade to 21.0.2, 25.0.2 or later

  ```sh
  cargo update -p wasmtime
  ```


## Technical details

A time-of-check versus time-of-use (TOCTOU) race condition exists in the `wasmtime::Engine` internal type registry. When multiple threads concurrently create and drop types (e.g., `FuncType`, `ArrayType`), an atomic decrement of a registration count can be interleaved with a re-registration, leading to a double-unregistration of a type slot. This corruption can cause a new, different type to be assigned to a previously used slot, potentially allowing a `call_indirect` dynamic type check to incorrectly pass. This results in a violation of WebAssembly's control-flow integrity (CFI) and type safety. The vulnerability is only exploitable if the engine is shared across multiple threads performing concurrent type operations.

## Affected products

- Bytecode Alliance 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

## Identifiers

- CVE-2024-47813
- GHSA-7qmx-3fpx-r45m
- PYSEC-2024-311
- RUSTSEC-2024-0439

## Timeline

- 2024-10-09: advisory
- 2024-10-09: disclosed
- 2024-10-09: patched

## References

- [https://api.github.com/users/fitzgen](https://api.github.com/users/fitzgen)
- [https://github.com/fitzgen](https://github.com/fitzgen)
- [https://api.github.com/users/fitzgen/gists%7B/gist_id%7D](https://api.github.com/users/fitzgen/gists%7B/gist_id%7D)
- [https://api.github.com/users/fitzgen/repos](https://api.github.com/users/fitzgen/repos)
- [https://avatars.githubusercontent.com/u/74571?v=4](https://avatars.githubusercontent.com/u/74571?v=4)
- [https://api.github.com/users/fitzgen/events%7B/privacy%7D](https://api.github.com/users/fitzgen/events%7B/privacy%7D)

## Related threats

- [RUSTSEC-2026-0422 - Typed functions with `i31` or `nullref` arguments may panic due to insufficient type-check](https://junglewise.ai/threats/rustsec-2026-0422-typed-functions-with-i31-or-nullref-arguments-may-0545dc2b)
- [Wasmtime type confusion with host-created struct types](https://junglewise.ai/threats/rustsec-2026-0423-cross-engine-type-confusion-with-host-created-struct-89fe3f0e)
- [Wasmtime unchecked memory usage in borrowed resource transfer](https://junglewise.ai/threats/rustsec-2026-0424-unchecked-memory-usage-in-transferring-borrowed-b297503c)
- [Wasmtime Cranelift aarch64 br_table sandbox escape](https://junglewise.ai/threats/cve-2026-115893-wasmtime-is-a-runtime-for-webassembly-prior-to-36-0-19-48-0-7)
- [Wasmtime component-model type-check bypass in stream/future lowering](https://junglewise.ai/threats/cve-2026-115892-wasmtime-is-a-runtime-for-webassembly-from-46-0-0-until-48-0-7)
