Wasmtime: Bit-packing in Cranelift compiler causes silent overflow and miscompilation
What fixes it
- 36.0.19wasmtime, rustGitHub
- 43.0.0wasmtime, rustGitHub
- 36.0.19wasmtime, crates.ioOSV
cargo update -p wasmtime --precise 36.0.19 - 43.0.0wasmtime, crates.ioOSV
cargo update -p wasmtime --precise 43.0.0
A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.
Reports 1
1 outlet mention it. Reports are not confirmation; each links to its source.
Description
Summary
In Wasmtime prior to v43, the Cranelift compiler backend bit-packs its SSA value indices in a way that can result in silent overflow in release builds, and result in incorrect value references in the IR resulting in arbitrary miscompilation. A very large Wasm function body, or one that is specially crafted to use many SSA values, can use this to force type-confusion or other arbitrary side-effects and escape the sandbox.
Cranelift was changed in Wasmtime v43 to use a full u32 index, with checks if that limit is exceeded, and so is no longer susceptible to this bug.
Impact
A Wasmtime engine with default settings (using the Cranelift backend) on any architecture/platform could experience a sandbox escape from a specially-crafted Wasm module.
Patches
Wasmtime v36.0.19 has been released which fixes this issue.
Text from GitHub Advisory Database
Affected versions 6
- wasmtime, rust< 36.0.19GitHub
- wasmtime, rust>= 37.0.0, < 43.0.0GitHub
- wasmtimeaffected: < 36.0.19CVE List
- wasmtimeaffected: >= 37.0.0, < 43.0.0CVE List
- wasmtime, crates.iofrom first release, fixed in 36.0.19OSV
- wasmtime, crates.iofrom 37.0.0, fixed in 43.0.0OSV
References 9
- github.com/bytecodealliance/wasmtime/commit/ba8f7d70caa1825b7f64fa75cd9d03f4a438dae0Fixvia CVE List
- github.com/bytecodealliance/wasmtime/commit/f517bd6e890c7c1291ab9fe05d8cc0c9f11e56aaFixvia CVE List
- github.com/bytecodealliance/wasmtime/releases/tag/v36.0.19Fixvia CVE List
- github.com/bytecodealliance/wasmtime/releases/tag/v43.0.0Fixvia CVE List
- github.com/bytecodealliance/wasmtime/security/advisories/GHSA-897f-g5gm-fmxmAdvisoryvia CVE List
- rustsec.org/advisories/RUSTSEC-2026-0380.htmlAdvisoryvia GitHub
- github.com/advisories/GHSA-897f-g5gm-fmxmAdvisoryvia GitHub
- github.com/bytecodealliance/wasmtime/pull/12613Referencevia CVE List
- github.com/bytecodealliance/wasmtime/pull/14818Referencevia CVE List