Dynamic record lifting can allocate beyond the hostcall fuel limit
Description
Impact
Wasmtime's implementation of the dynamically-typed [Val] API does not adequately account for the amount of host allocations performed when loading a value from a guest. This means that a guest can return a value which allocates significantly more memory on the host than the host is otherwise keeping track of. This is a hole in the mitigations applied as part of GHSA-852m-cvvp-9p4w and represents a possible denial-of-service vulnerability for hosts.
This vulnerability only affects the [Val] API of hosts. Hosts that use bindgen! and otherwise statically-typed APIs are unaffected by this issue. For hosts using [Val] the amount of extra memory that can be allocated on the host depends on the exact shape of the API in question but it can be at least ~100x extra memory, for example.
Patches
Wasmtime 36.0.16, 48.0.3, and 49.0.1 have been patched for this issue.
Workarounds
There is no known workaround to this and users are recommended to upgrade.
References
- [
ValAPI][Val] - GHSA-852m-cvvp-9p4w
[Val]: docs.rs/