Skip to main content
Menu
Advisories

Host panic when component call_async is cancelled under some conditions

GHSA-3R89-V5MQ-J5XFPublished Updated GitHub

Description

The Future returned by TypedFunc::call_async may trigger a panic when dropped under certain circumstances.

Details

The Drop implementation for the Future returned by TypedFunc::call_async includes code to clean up and possibly cancel its associated guest task. However, in the scenario where that task has not yet started (e.g. due to guest-imposed backpressure or because the runtime event loop has a backlog of pending work to finish first), the code responsible for finding and removing any work items associated with that task was only looking in one of several places in which those items might be found. Consequently, it returned an error prematurely if it couldn't find any such items which was escalated via a Result::unwrap to a panic in the Future's Drop implementation.

Impact

Embedder code using call_async and potentially dropping the returned Future before it has yielded a result may be affected.

Affected versions

References

GitHub · bytecodealliance/wasmtime