Skip to main content
Menu
Advisories

Mis-typed WebAssembly tag imports can lead to GC heap corruption

GHSA-CFHF-M2CR-62WJPublished Updated GitHub

Description

Impact

Wasmtime contained a bug where validation of WebAssembly components which instantiate a core module importing a WebAssembly tag was not implemented correctly. This bug meant that Wasmtime could accept an invalid component which is not sound. Specifically modules were allowed to import tags with a subtype of the original tag's type, which is not allowed by the WebAssembly specification.

This bug then enabled guests to mis-type the payload of an exception object which can lead to GC heap corruption. Wasmtime's GC heap is implemented to be resilient to corruption but this is nevertheless a bug to fix. Wasmtime is not 100% bug-free in the face of a corrupt GC heap at this time hence this advisory being issues. Wasmtime may panic in certain operations when the GC heap is corrupt, so users are recommended to update.

This bug only affects users when the WebAssembly exceptions proposal is enabled, which is on-by-default starting in Wasmtime 47.0.0.

Patches

Wasmtime 48.0.4 and 49.0.2 have been released which fix this validation error and correctly rejects ill-formed components.

Workarounds

There is no known workaround for this issue at this time and it's recommended that users upgrade or change their embedding to disable the WebAssembly exceptions proposal.

References

Are there any links users can visit to find out more?

Affected versions

References

GitHub · bytecodealliance/wasmtime