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

    Threat Intelligence

    EPSS
    0.16% (53rd 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 ID SNYK-RUST-WASMTIME-3357686
  • published 9 Mar 2023
  • disclosed 9 Mar 2023
  • credit afonso360

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
Expand this section

Snyk

Recommended
3.1 low
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    High
  • Privileges Required (PR)
    Low
  • User Interaction (UI)
    None
  • Scope (S)
    Unchanged
  • Confidentiality (C)
    None
  • Integrity (I)
    Low
  • Availability (A)
    None
Expand this section

NVD

4.3 medium