Off-by-one Error Affecting wasmtime package, versions <6.0.1-r0


Severity

Recommended
0.0
medium
0
10

Snyk's Security Team recommends NVD's CVSS assessment. Learn more

Threat Intelligence

EPSS
0.21% (59th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-CHAINGUARDLATEST-WASMTIME-5846740
  • published21 Aug 2023
  • disclosed8 Mar 2023

Introduced: 8 Mar 2023

CVE-2023-27477  (opens in a new tab)
CWE-193  (opens in a new tab)

How to fix?

Upgrade Chainguard wasmtime to version 6.0.1-r0 or higher.

NVD Description

Note: Versions mentioned in the description apply only to the upstream wasmtime package and not the wasmtime package as distributed by Chainguard. See How to fix? for Chainguard relevant fixed versions and status.

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.

CVSS Scores

version 3.1