Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS03NWhxLWg2ZzktaDRxNc4AA6jC

Wasmtime vulnerable to panic when using a dropped extenref-typed element segment

Impact

The 19.0.0 release of Wasmtime contains a regression introduced during its development which can lead to a guest WebAssembly module causing a panic in the host runtime. A valid WebAssembly module, when executed at runtime, may cause this panic. The panic in question is caused when a WebAssembly module issues a table.* instruction which uses a dropped element segment with a table that also has an externref type. This causes Wasmtime to erroneously use an empty function segment instead of an empty externref segment to perform this operation. This mismatch in types causes a panic in Wasmtime when it's asserted that an externref table is only viewed as externrefs.

This regression was introduced during the development of the 19.0.0 release and only affects the 19.0.0 release. This panic requires the reference-types WebAssembly feature to be enabled, and it is enabled by default. Toolchains are not known to generate this pattern by default so it's likely a module would need to be specifically crafted to trigger this panic.

A panic in a host runtime represents a possible denial-of-service in some scenarios. This panic cannot introduce memory unsafety or allow WebAssembly to break outside of its sandbox, however. There is no possible heap corruption or memory unsafety from this panic.

Patches

Wasmtime 19.0.1 has been released to fix this problem. Users of 19.0.0 should upgrade to 19.0.1. All other versions of Wasmtime are not affected by this issue.

Workarounds

If upgrading is not possible it's recommended to use config.reference_types(false). That will disable these modules at validation-time which prevents the possibility of a panic at runtime. If reference-types are required, however, then there is no other workaround at this time other than upgrading.

References

Permalink: https://github.com/advisories/GHSA-75hq-h6g9-h4q5
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS03NWhxLWg2ZzktaDRxNc4AA6jC
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Low
Classification: General
Published: about 1 month ago
Updated: 29 days ago


CVSS Score: 3.3
CVSS vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L

Identifiers: GHSA-75hq-h6g9-h4q5, CVE-2024-30266
References: Repository: https://github.com/bytecodealliance/wasmtime
Blast Radius: 11.2

Affected Packages

cargo:wasmtime
Dependent packages: 126
Dependent repositories: 2,459
Downloads: 7,003,038 total
Affected Version Ranges: = 19.0.0
Fixed in: 19.0.1
All affected versions: 19.0.0
All unaffected versions: 0.0.0, 0.3.0, 0.7.0, 0.8.0, 0.9.0, 0.10.0, 0.11.0, 0.12.0, 0.13.0, 0.15.0, 0.16.0, 0.17.0, 0.18.0, 0.19.0, 0.20.0, 0.21.0, 0.22.0, 0.23.0, 0.24.0, 0.25.0, 0.26.0, 0.26.1, 0.27.0, 0.28.0, 0.29.0, 0.30.0, 0.31.0, 0.32.0, 0.32.1, 0.33.0, 0.33.1, 0.34.0, 0.34.1, 0.34.2, 0.35.0, 0.35.1, 0.35.2, 0.35.3, 0.36.0, 0.37.0, 0.38.0, 0.38.1, 0.38.2, 0.38.3, 0.39.0, 0.39.1, 0.40.0, 0.40.1, 1.0.0, 1.0.1, 1.0.2, 2.0.0, 2.0.1, 2.0.2, 3.0.0, 3.0.1, 4.0.0, 4.0.1, 5.0.0, 5.0.1, 6.0.0, 6.0.1, 6.0.2, 7.0.0, 7.0.1, 8.0.0, 8.0.1, 9.0.0, 9.0.1, 9.0.2, 9.0.3, 9.0.4, 10.0.0, 10.0.1, 10.0.2, 11.0.0, 11.0.1, 11.0.2, 12.0.0, 12.0.1, 12.0.2, 13.0.0, 13.0.1, 14.0.0, 14.0.1, 14.0.2, 14.0.3, 14.0.4, 15.0.0, 15.0.1, 16.0.0, 17.0.0, 17.0.1, 17.0.2, 17.0.3, 18.0.0, 18.0.1, 18.0.2, 18.0.3, 18.0.4, 19.0.1, 19.0.2, 20.0.0