CVE-2026-34945: Host Stack Memory Leak via Type Confusion in Wasmtime Winch Compiler
Vulnerability ID: CVE-2026-34945
CVSS Score: 2.3
Published: 2026-04-09
The Wasmtime WebAssembly runtime is affected by a type confusion vulnerability in its Winch compiler backend when processing the table.size instruction. When the memory64 proposal is enabled, this flaw allows a malicious guest WebAssembly module to read uninitialized host stack memory, potentially leaking sensitive host data.
TL;DR
A static typing error in the Wasmtime Winch compiler results in a failure to fully initialize a 64-bit register when evaluating the size of 64-bit tables. This leaks 32 bits of uninitialized host stack data to the guest module, tracked as CVE-2026-34945.
Technical Details
- CWE ID: CWE-681
- Attack Vector: Network
- CVSS v4.0 Score: 2.3 (Low)
- Exploit Status: None
- KEV Status: Not Listed
- Affected Component: Winch Compiler Instruction Emitter
Affected Systems
- Wasmtime WebAssembly Runtime (Winch Compiler Backend)
-
Wasmtime: >= 25.0.0, < 36.0.7 (Fixed in:
36.0.7) -
Wasmtime: >= 37.0.0, < 42.0.2 (Fixed in:
42.0.2) -
Wasmtime: >= 43.0.0, < 43.0.1 (Fixed in:
43.0.1)
Code Analysis
Commit: 96dde3a
Fix table.size instruction emitter to query correct index type instead of hardcoding i32, preventing uninitialized memory leaks.
fn visit_table_size(&mut self, table: u32) -> Self::Output {
- self.context.stack.push(TypedReg::i32(size).into());
+ let dst = TypedReg::new(table_data.index_type(), size);
+ self.context.stack.push(dst.into());
}
Mitigation Strategies
- Upgrade Wasmtime to a patched release (36.0.7, 42.0.2, or 43.0.1).
- Disable the
memory64WebAssembly proposal in the Wasmtime engine configuration. - Switch the compiler backend from Winch to the default Cranelift compiler.
Remediation Steps:
- Identify all production and testing environments running Wasmtime.
- Review the engine configuration blocks to determine if
Config::compiler_builderspecifies Winch. - Review the engine configuration to determine if
Config::wasm_memory64is set totrue. - Update the
wasmtimedependency inCargo.tomlto version 36.0.7, 42.0.2, or 43.0.1. - Recompile the host application and redeploy.
References
- GHSA-m9w2-8782-2946 Security Advisory
- Bytecode Alliance Security Advisories Blog Post
- Wasmtime Fix Commit 96dde3aa67a5c456e4091ed60a9e3e774f0efd85
Read the full report for CVE-2026-34945 on our website for more details including interactive diagrams and full exploit analysis.
Top comments (0)