Summary
Workarounds
If upgrading is not an option for you at this time, you can avoid this miscompilation by disabling the Wasm simd proposal
config.wasm_simd(false);
Additionally the bug is only present on x86_64 hosts. Other platforms such as AArch64 and s390x are not affected.
References
- The WebAssembly simd proposal
- 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 generation backend, Cranelift, has a bug on x86_64 platforms for the WebAssembly i8x16.select instruction which will produce the wrong results when the same operand is provided to the instruction and some of the selected indices are greater than 16. There is an off-by-one error in the calculation of the mask to the pshufb instruction which causes incorrect results to be returned if lanes are selected from the second vector.
The impact of this miscompilation is that the WebAssembly instruction can produce incorrect results for the i8x16.select instruction. This should have no effect on embedders and does not represent a sandbox escape, for example. Guest programs, however, may behave unexpectedly due to the incorrect result of this instruction. In extreme cases if a guest program is handling untrusted input then the guest program may deviate from its intended execution, for example calling an imported host function with different arguments than intended. This still does not impact embedders, however, because there is no form of privilege escalation with the guest.
At this time it's expected that this codegen pattern doesn't show up in the wild that often. LLVM-generated modules, for example, do not appear to conventionally or idiomatically generate code which would hit this bug. It is possible, however, to still write code which triggers this, so it's recommended for embedders to analyze existing modules to see if any are affected.
CVE-2023-27477 has a CVSS score of 3.1 (Low). 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
This codegen bug has been fixed in Wasmtime 6.0.1, 5.0.1, and 4.0.1. Users are recommended to upgrade to these updated versions.
Frequently Asked Questions
- What is CVE-2023-27477? CVE-2023-27477 is a low-severity security vulnerability in wasmtime (rust), affecting versions >= 1.0.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.
- How severe is CVE-2023-27477? CVE-2023-27477 has a CVSS score of 3.1 (Low). 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-27477?
wasmtime(rust) (versions >= 1.0.0, < 4.0.1)cranelift-codegen(rust) (versions >= 0.88.0, < 0.91.1)
- Is there a fix for CVE-2023-27477? Yes. CVE-2023-27477 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-27477 exploitable, and should I be worried? Whether CVE-2023-27477 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-27477 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-27477?
- 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