Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. wasmtime
  4. ›
  5. CVE-2026-34971

CVE-2026-34971: Wasmtime: Miscompiled guest heap access enables sandbox escape on aarch64 Cranelift

April 9, 2026

Wasmtime’s Cranelift compilation backend contains a bug on aarch64 when performing a certain shape of heap accesses which means that the wrong address is accessed. When combined with explicit bounds checks a guest WebAssembly module this can create a situation where there are two diverging computations for the same address: one for the address to bounds-check and one for the address to load. This difference in address being operated on means that a guest module can pass a bounds check but then load a different address. Combined together this enables an arbitrary read/write primitive for guest WebAssembly when accesssing host memory. This is a sandbox escape as guests are able to read/write arbitrary host memory.

This vulnerability has a few ingredients, all of which must be met, for this situation to occur and bypass the sandbox restrictions:

  • This miscompiled shape of load only occurs on 64-bit WebAssembly linear memories, or when Config::wasm_memory64 is enabled. 32-bit WebAssembly is not affected.
  • Spectre mitigations or signals-based-traps must be disabled. When spectre mitigations are enabled then the offending shape of load is not generated. When signals-based-traps are disabled then spectre mitigations are also automatically disabled.

The specific bug in Cranelift is a miscompile of a load of the shape load(iadd(base, ishl(index, amt))) where amt is a constant. The amt value is masked incorrectly to test if it’s a certain value, and this incorrect mask means that Cranelift can pattern-match this lowering rule during instruction selection erroneously, diverging from WebAssembly’s and Cranelift’s semantics. This incorrect lowering would, for example, load an address much further away than intended as the correct address’s computation would have wrapped around to a smaller value insetad.

References

  • github.com/advisories/GHSA-jhxm-h53p-jm7w
  • github.com/bytecodealliance/wasmtime
  • github.com/bytecodealliance/wasmtime/security/advisories/GHSA-jhxm-h53p-jm7w
  • nvd.nist.gov/vuln/detail/CVE-2026-34971

Code Behaviors & Features

Detect and mitigate CVE-2026-34971 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 32.0.0 before 36.0.7, all versions starting from 37.0.0 before 42.0.2, all versions starting from 43.0.0 before 43.0.1, version 43.0.0

Fixed versions

  • 36.0.7
  • 42.0.2
  • 43.0.1

Solution

Upgrade to versions 36.0.7, 42.0.2, 43.0.1 or above.

Impact 9.9 CRITICAL

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-125: Out-of-bounds Read
  • CWE-787: Out-of-bounds Write

Source file

cargo/wasmtime/CVE-2026-34971.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Fri, 10 Apr 2026 12:19:28 +0000.