Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. wasmtime
  4. ›
  5. CVE-2022-23636

CVE-2022-23636: Invalid drop of partially-initialized instances in the pooling instance allocator for modules with defined `externref` globals

February 16, 2022 (updated May 2, 2025)

There exists a bug in the pooling instance allocator in Wasmtime’s runtime where a failure to instantiate an instance for a module that defines an externref global will result in an invalid drop of a VMExternRef via an uninitialized pointer.

As instance slots may be reused between consecutive instantiations, the value of the uninitialized pointer may be from a previous instantiation and therefore under the control of an attacker via a module’s initial values for its globals. If the attacker can somehow determine an address under their control inside the mapped memory representing the instance pool, it is possible to trick the runtime to call drop_in_place on a trait object under the attacker’s control and therefore cause remote code execution.

Exploiting the bug to cause remote code execution would be very difficult as attackers cannot determine the addresses of globals from code executing within the WebAssembly VM and the memory space for the instance pool cannot be statically determined. Operating system mitigations, such as address space layout randomization, would additionally increase the difficulty for attackers to determine useful executable code to target with an exploit. It is also very unlikely that attackers will be able to directly influence the conditions that trigger the bug as described below.

When the conditions to trigger the bug are met, however, it is much easier to exploit this bug to cause a denial of service by crashing the host with an invalid memory read.

The following engine configuration (via Config) is required to be impacted by this bug:

References

  • github.com/advisories/GHSA-88xq-w8cq-xfg7
  • github.com/bytecodealliance/wasmtime
  • github.com/bytecodealliance/wasmtime/commit/886ecc562040bef61faf19438c22285c2d62403a
  • github.com/bytecodealliance/wasmtime/security/advisories/GHSA-88xq-w8cq-xfg7
  • nvd.nist.gov/vuln/detail/CVE-2022-23636
  • rustsec.org/advisories/RUSTSEC-2022-0096.html

Code Behaviors & Features

Detect and mitigate CVE-2022-23636 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 0.33.1, all versions starting from 0.34.0 before 0.34.1, version 0.34.0

Fixed versions

  • 0.34.1
  • 0.33.1

Solution

Upgrade to versions 0.33.1, 0.34.1 or above.

Impact 8.1 HIGH

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

Learn more about CVSS

Weakness

  • CWE-824: Access of Uninitialized Pointer

Source file

cargo/wasmtime/CVE-2022-23636.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:44 +0000.