Off-by-one Error Affecting cranelift-codegen package, versions >=0.88.0 <0.91.1>=0.92.0 <0.92.1>=0.93.0 <0.93.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-CRANELIFTCODEGEN-3357685
  • 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 cranelift-codegen to version 0.91.1, 0.92.1, 0.93.1 or higher.

Overview

cranelift-codegen is a translates code from an intermediate representation into executable machine code.

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