Summary
Workarounds
While updating Wasmtime is recommended, there are a number of possible workarounds that embedders can employ to mitigate this issue if updating is not possible. Note that none of these workarounds are on-by-default and require explicit configuration:
- The
Config::static_memory_maximum_size(0)option can be used to force all accesses to linear memory to be explicitly bounds-checked. This will perform a bounds check separately from the address-mode computation which correctly calculates the effective address of a load/store. Note that this can have a large impact on the execution performance of WebAssembly modules. - The
Config::static_memory_guard_size(1 << 36)option can be used to greatly increase the guard pages placed after linear memory. This will guarantee that memory accesses up-to-34G away are guaranteed to be semantically correct by reserving unmapped memory for the instance. Note that this reserves a very large amount of virtual memory per-instances and can greatly reduce the maximum number of concurrent instances being run. - If using a non-x86_64 host is possible, then that will also work around this bug. This bug does not affect Wasmtime's or Cranelift's AArch64 backend, for example.
References
Config::static_memory_maximum_sizeConfig::static_memory_guard_size- Mailing list announcement
- GitHub advisory
- Commit to fix this issue on Wasmtime's
mainbranch
For more information
If you have any questions or comments about this advisory:
- Reach out to us on the Bytecode Alliance Zulip chat
- Open an issue in the bytecodealliance/wasmtime repository
Impact
Wasmtime's code generator, Cranelift, has a bug on x86_64 targets where address-mode computation mistakenly would calculate a 35-bit effective address instead of WebAssembly's defined 33-bit effective address. This bug means that, with default codegen settings, a wasm-controlled load/store operation could read/write addresses up to 35 bits away from the base of linear memory. Wasmtime's default sandbox settings provide up to 6G of protection from the base of linear memory to guarantee that any memory access in that range will be semantically correct. Due to this bug, however, addresses up to 0xffffffff * 8 + 0x7ffffffc = 36507222004 = ~34G bytes away from the base of linear memory are possible from guest code. This means that the virtual memory 6G away from the base of linear memory up to ~34G away can be read/written by a malicious module.
This out of bounds read/write is not semantically correct and poses a threat as an arbitrary read/write within ~34G of linear memory away from the base of a wasm module's linear memory. A guest module can, without the knowledge of the embedder, read/write memory in this region. The memory may belong to other WebAssembly instances when using the pooling allocator, for example. The memory may also belong to the embedder, depending on address layout.
Embedders do not have a necessarily reliable means of detecting when this happens. Wasm loads/stores are allowed to cause machine segfaults meaning that an invalid read/write would be translated to a nominal WebAssembly trap. This means that a malicious module in the worst case silently reads/writes memory outside its bounds and in the "best" case looks like a normal "something trapped here" during its execution. This makes it difficult to retroactively determine whether this bug has been exploited on hosts. Affected embedders are recommended to analyze preexisting wasm modules to see if they're affected by the incorrect codegen rules and possibly correlate that with an anomalous number of traps during historical execution to locate possibly suspicious modules.
The specific bug in Cranelift's x86_64 backend is that a WebAssembly address which is left-shifted by a constant amount from 1 to 3 will get folded into x86_64's addressing modes which perform shifts. For example (i32.load (i32.shl (local.get 0) (i32.const 3))) loads from the WebAssembly address $local0 << 3. When translated to Cranelift the $local0 << 3 computation, a 32-bit value, is zero-extended to a 64-bit value and then added to the base address of linear memory. Cranelift would generate an instruction of the form movl (%base, %local0, 8), %dst which calculates %base + %local0 << 3. The bug here, however, is that the address computation happens with 64-bit values, where the $local0 << 3 computation was supposed to be truncated to a 32-bit value. This means that %local0, which can use up to 32-bits for an address, gets 3 extra bits of address space to be accessible via this movl instruction.
The fix in Cranelift is to remove the erroneous lowering rules in the backend which handle these zero-extended expressions. The above example is then translated to movl %local0, %temp; shl $3, %temp; movl (%base, %temp), %dst which correctly truncates the intermediate computation of %local0 << 3 to 32-bits inside the %temp register which is then added to the %base value.
A read operation accesses a memory location beyond the intended buffer boundary. Typical impact: sensitive data disclosure or crash.
CVE-2023-26489 has a CVSS score of 9.9 (Critical). The vector is network-reachable, low privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (4.0.1, 5.0.1, 6.0.1, 0.91.1, 0.92.1, 0.93.1); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Remediation advice
Wasmtime version 4.0.1, 5.0.1, and 6.0.1 have been released and have all been patched to no longer contain the erroneous lowering rules.
Frequently Asked Questions
- What is CVE-2023-26489? CVE-2023-26489 is a critical-severity out-of-bounds read vulnerability in wasmtime (rust), affecting versions >= 0.37.0, < 4.0.1. It is fixed in 4.0.1, 5.0.1, 6.0.1, 0.91.1, 0.92.1, 0.93.1. A read operation accesses a memory location beyond the intended buffer boundary.
- How severe is CVE-2023-26489? CVE-2023-26489 has a CVSS score of 9.9 (Critical). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which packages are affected by CVE-2023-26489?
wasmtime(rust) (versions >= 0.37.0, < 4.0.1)cranelift-codegen(rust) (versions >= 0.84.0, < 0.91.1)
- Is there a fix for CVE-2023-26489? Yes. CVE-2023-26489 is fixed in 4.0.1, 5.0.1, 6.0.1, 0.91.1, 0.92.1, 0.93.1. Upgrade to this version or later.
- Is CVE-2023-26489 exploitable, and should I be worried? Whether CVE-2023-26489 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2023-26489 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2023-26489?
- Upgrade
wasmtimeto 4.0.1 or later - Upgrade
wasmtimeto 5.0.1 or later - Upgrade
wasmtimeto 6.0.1 or later - Upgrade
cranelift-codegento 0.91.1 or later - Upgrade
cranelift-codegento 0.92.1 or later - Upgrade
cranelift-codegento 0.93.1 or later
- Upgrade