Junglewise Threat Intelligence

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

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

Technologies: wasmtime (crates.io). Vendors: crates.io, PyPI.

Executive brief

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.

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

Timeline

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

References

Related threats