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


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.1% (30th 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-3112350
  • published11 Nov 2022
  • disclosed11 Nov 2022
  • creditAlex Crichton

Introduced: 11 Nov 2022

CVE-2022-39392  (opens in a new tab)
CWE-119  (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 due to a bug in Wasmtime's implementation of its pooling instance allocator when the allocator is configured to give WebAssembly instances a maximum of zero pages of memory.

Note:

This bug can only be triggered by setting InstanceLimits::memory_pages to zero. This bug is not applicable with the default settings of the wasmtime crate.

Workaround

Users who are unable to upgrade to the fixed version can disable the usage of the pooling allocator (not enabled by default).

The vulnerability can also be mitigated by increasing the memory_pages allotment when configuring the pooling allocator to a value greater than zero. If an embedding wishes to still prevent memory from actually being used then the Store::limiter method can be used to dynamically disallow growth of memory beyond 0 bytes large. Note that the default memory_pages value is greater than zero.

CVSS Base Scores

version 3.1