CVE-2023-26489: Guest-controlled out-of-bounds read/write on x86_64 in wasmtime
bytecodealliance · wasmtime
Affected: bytecodealliance wasmtime · Exploitation: possible (1 to 10%)
Not in CyberSIXT coverage yet: no article names this CVE. This page shows the public record.
Higher than 69% of scored CVEs
DescriptionCVE.org
wasmtime is a fast and secure runtime for WebAssembly. In affected versions 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. 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. 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. 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 a 32-bit value.
Affected products1
From the CVE record. A product or version that is not listed is unknown, not unaffected.
- bytecodealliance · wasmtimecranelift-codegen: >= 0.84.0, < 0.91.1; cranelift-codegen: >= 0.92.0, < 0.92.1; cranelift-codegen: >= 0.93.0, < 0.93.1; wasmtime: >= 0.37.0, < 4.0.1; wasmtime: >= 5.0.0, < 5.0.1; wasmtime: >= 6.0.0, < 6.0.1
On the Atlas
Every published CVE is on the CyberSIXT Atlas, grouped by weakness, vendor and month.
- Exploitation
- Possible (1 to 10%). EPSS between 1% and 10%.
- CISA KEV
- Not listed
- Public check
- No public nuclei template
- Vendor
- bytecodealliance
- Published
- March 2023
CoverageNo articles yet
No CyberSIXT article names CVE-2023-26489 yet, so there is no coverage timeline, action brief or change log for it. Everything on this page comes from the public CVE record, CISA KEV, EPSS and the nuclei template index. Search the archive or see the CVEs in the news.
References
- NVD entrynvd.nist.gov
- CVE recordcve.org
- Weakness CWE-125cwe.mitre.org
- github.com/bytecodealliance/wasmtime/security/advisories/GHSA-ffgithub.com
- github.com/bytecodealliance/wasmtime/commit/63fb30e4b4415455d47bgithub.com
- docs.rs/wasmtime/latest/wasmtime/struct.Config.html#method.statidocs.rs
- docs.rs/wasmtime/latest/wasmtime/struct.Config.html#method.statidocs.rs
- groups.google.com/a/bytecodealliance.org/g/sec-announce/c/Mov-Itgroups.google.com