Vulnerability HighRUSTSEC-2022-0076 · wasmtime
RUSTSEC-2022-0076: Bug in Wasmtime implementation of pooling instance allocator
Short answerA security vulnerability in the wasmtime crate: Bug in Wasmtime implementation of pooling instance allocator. High severity (CVSS 7.4). Fixed in 1.0.2, 2.0.2: update to a fixed version.
| Crate | wasmtime |
|---|---|
| Type | Vulnerability (memory-corruption, memory-exposure) |
| Affected versions | Before 1.0.2; from 2.0.0 before 2.0.2. |
| Fixed in | 1.0.2, 2.0.2 |
| Severity | High, CVSS 7.4 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N |
| Published | 2022-11-10 |
| Last changed | 2026-10-12 |
| Also known as | CVE-2022-39392, GHSA-44mr-8vmm-wjhg, RUSTSEC-2022-0102 |
| Affected functions | wasmtime::Config::allocation_strategy, wasmtime::PoolingAllocationConfig::instance_memory_pages |
What to do
- See which version you have:
cargo tree -i wasmtime(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p wasmtime. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for examplewasmtime = "2.0.2") or update the dependency that pulls it in. - Check again with
cargo audit, or paste your Cargo.lock into our Cargo.toml checker.
Details from the advisory
Bug in Wasmtime's implementation of its pooling instance allocator when the allocator is configured to give WebAssembly instances a maximum of zero pages of memory.
In this configuration, the virtual memory mapping for WebAssembly memories did not meet the compiler-required configuration requirements for safely executing WebAssembly modules. Wasmtime's default settings require virtual memory page faults to indicate that wasm reads/writes are out-of-bounds, but the pooling allocator's configuration would not create an appropriate virtual memory mapping for this meaning out of bounds reads/writes can successfully read/write memory unrelated to the wasm sandbox within range of the base address of the memory mapping created by the pooling allocator.
This bug is not applicable with the default settings of the wasmtime crate.
This bug can only be triggered by setting InstanceLimits::memory_pages to zero.
This is expected to be a very rare configuration since this means that wasm modules cannot allocate any pages of linear memory.
All wasm modules produced by all current toolchains are highly likely to use linear memory, so it's expected to be unlikely that this configuration is set to zero by any production embedding of Wasmtime.
References
- Package: crates.io/crates/wasmtime
- Advisory: rustsec.org/advisories/RUSTSEC-2022-0076.html
- Web: github.com/bytecodealliance/wasmtime/commit/e60c3742904ccbb3e26da201c9221c38a4981d72
- Web: github.com/bytecodealliance/wasmtime/commit/e60c3742904ccbb3e26da201c9221c38a4981d72
From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.
Other advisories for wasmtime
- Vulnerability MediumRUSTSEC-2021-0110 · 2021-09-17Multiple Vulnerabilities in Wasmtime
- VulnerabilityRUSTSEC-2022-0016 · 2022-03-31Use after free with `externref`s and epoch interruption in Wasmtime
- VulnerabilityRUSTSEC-2022-0075 · 2022-11-10Bug in pooling instance allocator
- VulnerabilityRUSTSEC-2022-0095 · 2022-06-27Miscompilation of `i8x16.swizzle` and `select` with v128 inputs
- VulnerabilityRUSTSEC-2022-0096 · 2022-02-17Invalid drop of VMExternRef from partially-initialized instances in the pooling instance allocator
- Vulnerability LowRUSTSEC-2022-0097 · 2022-11-07Out of bounds write in `wasmtime_trap_code` C API function
- Vulnerability HighRUSTSEC-2022-0098 · 2022-11-05Data leakage between instances in the pooling allocator
- VulnerabilityRUSTSEC-2022-0099 · 2022-03-28 Use after free with `externref`s and epoch interruption in Wasmtime
Up next
Same cratewasmtime: security historyEvery advisory for this crate, and whether it is safe to use today.Read it next →Did this answer your question?