Out-of-bounds Write Affecting bytecodealliance/wasmtime package, versions [,1.0.2)[2.0.0,2.0.2)


Severity

Recommended
0.0
low
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.06% (18th 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-UNMANAGED-BYTECODEALLIANCEWASMTIME-3112351
  • published11 Nov 2022
  • disclosed11 Nov 2022
  • creditKonstantin Preißer

Introduced: 11 Nov 2022

CVE-2022-39394  (opens in a new tab)
CWE-787  (opens in a new tab)

How to fix?

Upgrade bytecodealliance/wasmtime to version 1.0.2, 2.0.2 or higher.

Overview

Affected versions of this package are vulnerable to Out-of-bounds Write due to a bug in Wasmtime's C API implementation where the definition of the wasmtime_trap_code does not match its declared signature in the wasmtime/trap.h header file. This discrepancy causes the function implementation to perform a 4-byte write into a 1-byte buffer provided by the caller.

Workaround

Users who are unable to upgrade to the fixed version can provide a 4-byte buffer casted to a 1-byte buffer when calling wasmtime_trap_code. Users of the wasmtime crate are not affected by this issue, only users of the C API function wasmtime_trap_code are affected.

CVSS Base Scores

version 3.1