{"answers":{"affected":"13 open source packages ship an affected version, including wasmtime and cranelift-codegen. It affects 2 products.","exploited":"There is no known exploitation of CVE-2023-26489 in the wild and no public exploit code.","fix":"Upgrade wasmtime to a fixed version for your release line: 4.0.1, 5.0.1 or 6.0.1.","what":"CVE-2023-26489 is a critical memory corruption vulnerability in bytecodealliance wasmtime, published on 8 Mar 2023. Any signed-in user can exploit it over the network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2023-26489 and fix it if it is affected.\n\nWhat it is: CVE-2023-26489 is a critical memory corruption vulnerability in bytecodealliance wasmtime, published on 8 Mar 2023. Any signed-in user can exploit it over the network, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2023-26489 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- wasmtime (crates.io): affected from 0.0.0-0; fixed in 4.0.1, 5.0.1, 6.0.1\n- wasmtime (crates.io): affected from 0.37.0; fixed in 4.0.1\n- wasmtime (crates.io): affected from 0.37.0; fixed in 4.0.1\n- wasmtime (crates.io): affected from 5.0.0; fixed in 5.0.1\n- wasmtime (crates.io): affected from 5.0.0; fixed in 5.0.1\n- wasmtime (crates.io): affected from 6.0.0; fixed in 6.0.1\n- wasmtime (crates.io): affected from 6.0.0; fixed in 6.0.1\n- cranelift-codegen (crates.io): affected from 0.84.0; fixed in 0.91.1\n- cranelift-codegen (crates.io): affected from 0.84.0; fixed in 0.91.1\n- cranelift-codegen (crates.io): affected from 0.92.0; fixed in 0.92.1\n- cranelift-codegen (crates.io): affected from 0.92.0; fixed in 0.92.1\n- cranelift-codegen (crates.io): affected from 0.93.0; fixed in 0.93.1\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2023-26489/ (Markdown: https://insights.sbomify.com/CVE-2023-26489/index.md)","id":"CVE-2023-26489","markdown":"https://insights.sbomify.com/CVE-2023-26489/index.md","name":"CVE-2023-26489","record":{"aliases":["GHSA-ff4p-7xrq-q5r8","RUSTSEC-2023-0090"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_read","data_modify"],"network_reachable":"yes","non_default_config":false,"product_category":"WebAssembly runtime","requires_auth":"low_privilege","summary":"A malicious WebAssembly module can read or write memory outside its sandbox due to an address calculation bug in the x86_64 code generator.","user_interaction":"not_required","vuln_class":"memory_corruption"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"cranelift-codegen","vendor":"bytecodealliance"},{"product":"wasmtime","vendor":"bytecodealliance"}],"cvss":{"score":10,"severity":"critical","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-787","name":"Out-of-bounds Write"},{"id":"CWE-125","name":"Out-of-bounds Read"}],"description":"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 \u003c\u003c 3`. When translated to Cranelift the `$local0 \u003c\u003c 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 \u003c\u003c 3`. The bug here, however, is that the address computation happens with 64-bit values, where the `$local0 \u003c\u003c 3` computation was supposed to be truncated to a 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 expression. 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 \u003c\u003c 3` to 32-bits inside the `%temp` register which is then added to the `%base` value. 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. 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: 1. 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. 2. The `Config::static_memory_guard_size(1 \u003c\u003c 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. 3. 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.","ecosystems":["crates.io"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Guest-controlled out-of-bounds read/write on x86_64 in wasmtime","id":"CVE-2023-26489","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"crates.io","product":null,"products":[],"type":"memory_corruption","year":"2023"},"n_packages":13,"n_references":5,"next":{"headline":"mailcow is vulnerable to shell command injection via xoauth2 authentication in imapsync​","id":"CVE-2023-26490"},"packages":[{"ecosystem":"crates.io","fixed":["0.91.1"],"introduced":["0.84.0"],"last_affected":[],"package":"cranelift-codegen","purl":null,"source":"GHSA-ff4p-7xrq-q5r8"},{"ecosystem":"crates.io","fixed":["0.91.1"],"introduced":["0.84.0"],"last_affected":[],"package":"cranelift-codegen","purl":"pkg:cargo/cranelift-codegen","source":"GHSA-ff4p-7xrq-q5r8"},{"ecosystem":"crates.io","fixed":["0.92.1"],"introduced":["0.92.0"],"last_affected":[],"package":"cranelift-codegen","purl":null,"source":"GHSA-ff4p-7xrq-q5r8"},{"ecosystem":"crates.io","fixed":["0.92.1"],"introduced":["0.92.0"],"last_affected":[],"package":"cranelift-codegen","purl":"pkg:cargo/cranelift-codegen","source":"GHSA-ff4p-7xrq-q5r8"},{"ecosystem":"crates.io","fixed":["0.93.1"],"introduced":["0.93.0"],"last_affected":[],"package":"cranelift-codegen","purl":null,"source":"GHSA-ff4p-7xrq-q5r8"},{"ecosystem":"crates.io","fixed":["0.93.1"],"introduced":["0.93.0"],"last_affected":[],"package":"cranelift-codegen","purl":"pkg:cargo/cranelift-codegen","source":"GHSA-ff4p-7xrq-q5r8"},{"ecosystem":"crates.io","fixed":["4.0.1","5.0.1","6.0.1"],"introduced":["0.0.0-0","5.0.0","6.0.0"],"last_affected":[],"package":"wasmtime","purl":"pkg:cargo/wasmtime","source":"RUSTSEC-2023-0090"},{"ecosystem":"crates.io","fixed":["4.0.1"],"introduced":["0.37.0"],"last_affected":[],"package":"wasmtime","purl":null,"source":"GHSA-ff4p-7xrq-q5r8"},{"ecosystem":"crates.io","fixed":["4.0.1"],"introduced":["0.37.0"],"last_affected":[],"package":"wasmtime","purl":"pkg:cargo/wasmtime","source":"GHSA-ff4p-7xrq-q5r8"},{"ecosystem":"crates.io","fixed":["5.0.1"],"introduced":["5.0.0"],"last_affected":[],"package":"wasmtime","purl":null,"source":"GHSA-ff4p-7xrq-q5r8"},{"ecosystem":"crates.io","fixed":["5.0.1"],"introduced":["5.0.0"],"last_affected":[],"package":"wasmtime","purl":"pkg:cargo/wasmtime","source":"GHSA-ff4p-7xrq-q5r8"},{"ecosystem":"crates.io","fixed":["6.0.1"],"introduced":["6.0.0"],"last_affected":[],"package":"wasmtime","purl":null,"source":"GHSA-ff4p-7xrq-q5r8"},{"ecosystem":"crates.io","fixed":["6.0.1"],"introduced":["6.0.0"],"last_affected":[],"package":"wasmtime","purl":"pkg:cargo/wasmtime","source":"GHSA-ff4p-7xrq-q5r8"}],"prev":{"headline":"OpenZeppelin Contracts contains Incorrect Calculation","id":"CVE-2023-26488"},"products":["wasmtime"],"published":"2023-03-08","related":[{"cvss_score":7.2,"headline":"Memory access due to code generation flaw in Cranelift module","id":"CVE-2021-32629","kev_date_added":null,"published":"2021-05-24"},{"cvss_score":6.4,"headline":"Use After Free in Wasmtime","id":"CVE-2022-31146","kev_date_added":null,"published":"2022-07-20"},{"cvss_score":5.9,"headline":"Cranelift vulnerable to miscompilation of constant values in division on AArch64","id":"CVE-2022-31169","kev_date_added":null,"published":"2022-07-21"},{"cvss_score":4.8,"headline":"Miscompilation of `i8x16.swizzle` and `select` with v128 inputs in Wasmtime","id":"CVE-2022-31104","kev_date_added":null,"published":"2022-06-27"},{"cvss_score":3.1,"headline":"wasmtime vulnerable to miscompilation of `i8x16.select` with the same inputs on x86_64","id":"CVE-2023-27477","kev_date_added":null,"published":"2023-03-08"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"open","licence":"CC0 1.0","name":"RustSec","prefix":"RUSTSEC"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"total"},"state":"PUBLISHED","updated":"2025-02-25","vendors":["bytecodealliance"]},"summary":"A malicious WebAssembly module can read or write memory outside its sandbox due to an address calculation bug in the x86_64 code generator.","url":"https://insights.sbomify.com/CVE-2023-26489/"}