Off-by-one Error Affecting wasmtime package, versions >=1.0.0 <4.0.1>=5.0.0 <5.0.1>=6.0.0 <6.0.1


Severity

Recommended
0.0
low
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.16% (54th 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-RUST-WASMTIME-3357686
  • published9 Mar 2023
  • disclosed9 Mar 2023
  • creditafonso360

Introduced: 9 Mar 2023

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

How to fix?

Upgrade wasmtime to version 4.0.1, 5.0.1, 6.0.1 or higher.

Overview

Affected versions of this package are vulnerable to Off-by-one Error in the calculation of the mask to the pshufb instruction. The vulnerability exists due to 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.

Workaround

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.

CVSS Scores

version 3.1