{"id":"EUVD-2021-0465","enisaUuid":"228794d4-f317-3c92-8053-02fa5a3334e1","description":"Wasmtime is an open source runtime for WebAssembly \u0026 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\u0027s 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\u0027s 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. If using multiple `Engine`s is required then code should be audited to ensure that `Linker` is only used with one `Engine`.","datePublished":"Sep 17, 2021, 8:10:13 PM","dateUpdated":"Aug 4, 2024, 1:58:18 AM","baseScore":6.3,"baseScoreVersion":"3.1","baseScoreVector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:H","references":"https://crates.io/crates/wasmtime\nhttps://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-q879-9g95-56mx\nhttps://github.com/bytecodealliance/wasmtime/commit/b39f087414f27ae40c44449ed5d1154e03449bff\nhttps://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/Z2Z33FTXFQ6EOINVEQIP4DFBG53G5XIY/\nhttps://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/WAVBRYDDUIY2ZR3K3FO4BVYJKIMJ5TP7/\n","aliases":"CVE-2021-39219\nGHSA-q879-9g95-56mx\nPYSEC-2021-322\n","assigner":"GitHub_M","epss":0.36,"enisaIdProduct":[{"id":"27200b5a-07a3-374e-a648-347a25fa2cec","product":{"name":"wasmtime","vendor":{"name":"bytecodealliance"}},"product_version":"≤ 0.29.0"}],"enisaIdVendor":[{"id":"1656c5fa-c250-323a-a0fc-d4d5b434399b","vendor":{"name":"bytecodealliance"}}],"enisaIdVulnerability":[{"id":"43d98b9d-f694-3d6b-b603-d248f913fc5f","vulnerability":{"id":"PYSEC-2021-322","description":"Wasmtime is an open source runtime for WebAssembly \u0026 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\u0027s 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\u0027s 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. If using multiple `Engine`s is required then code should be audited to ensure that `Linker` is only used with one `Engine`.","datePublished":"Sep 17, 2021, 8:15:00 PM","dateUpdated":"Sep 17, 2021, 10:30:49 PM","baseScore":0.0,"references":"https://crates.io/crates/wasmtime\nhttps://github.com/bytecodealliance/wasmtime/commit/b39f087414f27ae40c44449ed5d1154e03449bff\nhttps://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-q879-9g95-56mx\n","enisa_id":"EUVD-2021-0465\n","aliases":"CVE-2021-39219\nGHSA-q879-9g95-56mx\n","epss":0.0,"dataProcessed":"Nov 22, 2026, 3:03:51 AM","vulnerabilityProduct":[],"vulnerabilityVendor":[]}},{"id":"7a8c9be6-174a-35c4-aa04-4ae41e7ef920","vulnerability":{"id":"GHSA-q879-9g95-56mx","description":"Wrong type for `Linker`-define functions when used across two `Engine`s","datePublished":"Sep 20, 2021, 7:54:26 PM","dateUpdated":"Nov 19, 2024, 6:05:19 PM","baseScore":null,"references":"https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-q879-9g95-56mx\nhttps://nvd.nist.gov/vuln/detail/CVE-2021-39219\nhttps://github.com/bytecodealliance/wasmtime/commit/b39f087414f27ae40c44449ed5d1154e03449bff\nhttps://crates.io/crates/wasmtime\nhttps://github.com/bytecodealliance/wasmtime\nhttps://github.com/bytecodealliance/wasmtime-py/compare/0.29.0...0.30.0\nhttps://github.com/pypa/advisory-database/tree/main/vulns/wasmtime/PYSEC-2021-322.yaml\nhttps://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/WAVBRYDDUIY2ZR3K3FO4BVYJKIMJ5TP7\nhttps://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/Z2Z33FTXFQ6EOINVEQIP4DFBG53G5XIY\nhttps://rustsec.org/advisories/RUSTSEC-2021-0110.html\n","enisa_id":"EUVD-2021-0465\n","aliases":"GHSA-q879-9g95-56mx\nCVE-2021-39219\n","epss":0.0,"dataProcessed":"Nov 22, 2026, 2:06:55 AM","vulnerabilityProduct":[],"vulnerabilityVendor":[]}},{"id":"94dd6177-b811-3d0a-bde9-60a772ddd9cc","vulnerability":{"id":"CVE-2021-39219","description":"Wasmtime is an open source runtime for WebAssembly \u0026 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\u0027s 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\u0027s 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. If using multiple `Engine`s is required then code should be audited to ensure that `Linker` is only used with one `Engine`.","datePublished":"Sep 17, 2021, 8:10:13 PM","dateUpdated":"Aug 4, 2024, 1:58:18 AM","status":"PUBLISHED","baseScore":6.3,"baseScoreVersion":"3.1","baseScoreVector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:H","references":"https://crates.io/crates/wasmtime\nhttps://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-q879-9g95-56mx\nhttps://github.com/bytecodealliance/wasmtime/commit/b39f087414f27ae40c44449ed5d1154e03449bff\nhttps://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/Z2Z33FTXFQ6EOINVEQIP4DFBG53G5XIY/\nhttps://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/WAVBRYDDUIY2ZR3K3FO4BVYJKIMJ5TP7/\n","enisa_id":"EUVD-2021-0465\n","assigner":"GitHub_M","epss":0.36,"dataProcessed":"Nov 24, 2026, 7:27:05 AM","vulnerabilityProduct":[{"id":"f3597768-9011-3b12-b173-fa8cdb7c3fce","product":{"name":"wasmtime","vendor":{"name":"bytecodealliance"}},"product_version":"≤ 0.29.0"}],"vulnerabilityVendor":[{"id":"723ca5c4-33a7-31a3-9588-1744190be318","vendor":{"name":"bytecodealliance"}}]}}],"enisaIdAdvisory":[]}