Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🦀 crates.io

GHSA-88xq-w8cq-xfg7

MEDIUM

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

Also known asCVE-2022-23636CVE-2022-31169GHSA-7f6x-jwh5-m9r4RUSTSEC-2022-0096RUSTSEC-2022-0101
Published
Feb 16, 2022
Updated
May 2, 2025
Affected
2 pkgs
Patched
2 / 2
Exploits
None indexed

EPSS Exploitation Probability

via FIRST.org ↗
0.8%probability of exploitation in next 30 days
Lower Risk50th percentile+0.58%
0.00%0.42%0.84%1.26%0.2%0.8%Dec 25Apr 26Jun 26

EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.

Blast Radius

2 pkgs affected
🦀wasmtime🦀wasmtime

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects crates.io packages — download data is not available via public APIs for these ecosystems.

Description

Impact

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:

  • support for the reference types proposal must be enabled (this is the default for Config).
  • a pooling allocation strategy must be configured via Config::allocation_strategy, which is not the default allocation strategy.

A module must be instantiated with all the following characteristics:

  • The module defines at least one table or memory.
  • The module defines at least one externref global.

During instantiation, one of the following must occur to cause the instantiation to fail:

  • a call to mprotect or VirtualAlloc fails (e.g. out-of-memory conditions).
  • a resource limiter was configured in the associated Store (via Store::limiter or Store::limiter_async) and the limiter returns false from the initial call to memory_growing or table_growing. Stores do not have a resource limiter set by default.

This results in a partially-initialized instance being dropped and that attempts to drop the uninitialized VMExternRef representing the defined externref global.

We have reason to believe that the effective impact of this bug is relatively small because the usage of externref is still uncommon and without a resource limiter configured on the Store, which is not the default configuration, it is only possible to trigger the bug from an error returned by mprotect or VirtualAlloc.

Note that on Linux with the uffd feature enabled, it is only possible to trigger the bug from a resource limiter as the call to mprotect is skipped; if no resource limiter is used, then this configuration is not vulnerable.

Patches

The bug has been fixed in 0.34.1 and 0.33.1; users are encouraged to upgrade as soon as possible.

Workarounds

If it is not possible to upgrade to 0.34.1 or 0.33.1 of the wasmtime crate, it is recommend that support for the reference types proposal be disabled by passing false to Config::wasm_reference_types.

Doing so will prevent modules that use externref from being loaded entirely.

For more information

If you have any questions or comments about this advisory:

Affected Packages

2 total 2 fixed
EcosystemPackageVulnerable rangeFix
🦀crates.iowasmtime0.34.0&&< 0.34.10.34.1
🦀crates.iowasmtimeall versions0.33.1

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for wasmtime. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.

  2. Fix

    Update wasmtime to 0.34.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-88xq-w8cq-xfg7 is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 pinpoints whether GHSA-88xq-w8cq-xfg7 is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.

Tailored to GHSA-88xq-w8cq-xfg7. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

### Impact 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 represent
O3 Security · Impact-Aware SCA

Is GHSA-88xq-w8cq-xfg7 in your dependencies?

O3 detects GHSA-88xq-w8cq-xfg7 across crates.io dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.

GHSA-88xq-w8cq-xfg7: wasmtime Remote Code Execution (Medium 5.1) | O3 Security