CVE-2021-39219: Wrong type for `Linker`-define functions when used across two `Engine`s
bytecodealliance · wasmtime
Fixed in 0.30.0 · Affected: bytecodealliance wasmtime before 0.30.0 · Exploitation: unlikely (under 1%)
Not in CyberSIXT coverage yet: no article names this CVE. This page shows the public record.
Higher than 30% of scored CVEs
DescriptionCVE.org
Wasmtime is an open source runtime for WebAssembly & WASI. Wasmtime before version 0.30.0 is affected by a type confusion vulnerability. As a Rust library the `wasmtime` crate clearly marks which functions are safe and which are `unsafe`, guaranteeing that if consumers never use `unsafe` then it should not be possible to have memory unsafety issues in their embeddings of Wasmtime. An issue was discovered in the safe API of `Linker::func_*` APIs. These APIs were previously not sound when one `Engine` was used to create the `Linker` and then a different `Engine` was used to create a `Store` and then the `Linker` was used to instantiate a module into that `Store`. Cross-`Engine` usage of functions is not supported in Wasmtime and this can result in type confusion of function pointers, resulting in being able to safely call a function with the wrong type. Triggering this bug requires using at least two `Engine` values in an embedding and then additionally using two different values with a `Linker` (one at the creation time of the `Linker` and another when instantiating a module with the `Linker`). It's expected that usage of more-than-one `Engine` in an embedding is relatively rare since an `Engine` is intended to be a globally shared resource, so the expectation is that the impact of this issue is relatively small. The fix implemented is to change this behavior to `panic!()` in Rust instead of silently allowing it. Using different `Engine` instances with a `Linker` is a programmer bug that `wasmtime` catches at runtime. This bug has been patched and users should upgrade to Wasmtime version 0.30.0. If you cannot upgrade Wasmtime and are using more than one `Engine` in your embedding it's recommended to instead use only one `Engine` for the entire program if possible. An `Engine` is designed to be a globally shared resource that is suitable to have only one for the lifetime of an entire process.
Affected products1
From the CVE record. A product or version that is not listed is unknown, not unaffected.
- bytecodealliance · wasmtime<= 0.29.0
On the Atlas
Every published CVE is on the CyberSIXT Atlas, grouped by weakness, vendor and month.
- Exploitation
- Unlikely (under 1%). EPSS under 1%, or no score yet.
- CISA KEV
- Not listed
- Public check
- No public nuclei template
- Vendor
- bytecodealliance
- Published
- September 2021
CoverageNo articles yet
No CyberSIXT article names CVE-2021-39219 yet, so there is no coverage timeline, action brief or change log for it. Everything on this page comes from the public CVE record, CISA KEV, EPSS and the nuclei template index. Search the archive or see the CVEs in the news.
References
- NVD entrynvd.nist.gov
- CVE recordcve.org
- Weakness CWE-843cwe.mitre.org
- Vendor advisorylists.fedoraproject.org
- Vendor advisorylists.fedoraproject.org
- crates.io/crates/wasmtimecrates.io
- github.com/bytecodealliance/wasmtime/security/advisories/GHSA-q8github.com
- github.com/bytecodealliance/wasmtime/commit/b39f087414f27ae40c44github.com