CVE-2026-140417: Panic in `Caller::get_module_export` when a host function isn't called from WebAssembly
This is an entry in the RustSec database for the Wasmtime security advisory located at https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-hj27-mpw9-ff4c For more information see the GitHub-hosted security advisory.
Other sources
Wasmtime before 36.0.21, 37.0.0 before 48.0.9, 49.0.0 before 49.0.6, and 50.0.0 before 50.0.2 panics in Caller::getmoduleexport when a host function is invoked by the embedder rather than from WebAssembly, because Caller then refers to a placeholder instance with no module. A malicious core WebAssembly module can import a host function that uses this API and re-export it to the embedder, crashing the host when the embedder calls it.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
rust/wasmtimeto a version that resolves this vulnerability.Fixed in 36.0.21 - Upgrade
Upgrade
rust/wasmtimeto a version that resolves this vulnerability.Fixed in 48.0.9 - Upgrade
Upgrade
rust/wasmtimeto a version that resolves this vulnerability.Fixed in 49.0.6 - Upgrade
Upgrade
rust/wasmtimeto a version that resolves this vulnerability.Fixed in 50.0.2
Event History
Frequently Asked Questions
Which deployments are exposed to this denial of service?
Deployments are exposed if they use an affected Wasmtime version, run potentially malicious core WebAssembly modules, and provide a host function that calls Caller::get_module_export. The issue is triggered only when that host function is imported and re-exported by the module, then invoked by the embedder rather than from WebAssembly.
What must an attacker be able to do to trigger the crash?
An attacker needs to supply a core WebAssembly module that imports a relevant host function and re-exports it. The embedder must then call the re-exported host function; this causes Wasmtime to panic because Caller refers to a placeholder instance without a module.
Which versions contain the fix?
The fixed versions are 36.0.21, 48.0.9, 49.0.6, and 50.0.2. Affected ranges are versions before 36.0.21, 37.0.0 through before 48.0.9, 49.0.0 through before 49.0.6, and 50.0.0 through before 50.0.2.
What can be done if upgrading is not immediately possible?
Avoid calling host functions through module re-exports when those functions use Caller::get_module_export. In particular, do not invoke such functions from the embedder after a WebAssembly module imports and re-exports them.