{"schemaVersion":3,"id":"CVE-2021-39219","aliases":[],"status":"published","duplicateOf":null,"title":null,"description":"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. If using multiple `Engine`s is required then code should be audited to ensure that `Linker` is only used with one `Engine`.","dates":{"published":"2021-09-17T20:10:13.000Z","modified":"2024-08-04T01:58:18.272Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":6.3,"severity":"medium","version":"3.1","versionLabel":"v3.1","source":"CVE.org","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:H","computed":false,"selection":"backend-summary"},"metrics":[{"version":"3.1","versionLabel":"v3.1","source":"CVE.org","score":6.3,"severity":"medium","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:H","exploitability":null,"impact":null,"computed":false}]},"epss":{"probability":0.00361,"percentile":0.28476,"severity":"low","asOf":"2026-10-20T00:00:00.000Z","change":{"pp":0,"baselineDate":"2026-09-20T00:00:00.000Z","baselineScore":0.00361},"history":[{"date":"2026-09-14T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-09-15T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-09-16T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-09-17T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-09-18T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-09-19T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.00361,"percentile":0.28476}],"last30":[{"date":"2026-09-20T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.00361,"percentile":0.28476}]},"kev":{"state":"not-listed","entries":[],"listedCount":0,"totalCatalogs":3,"catalogs":[{"source":"cisa","label":"CISA","listed":false,"entry":null},{"source":"enisa","label":"ENISA","listed":false,"entry":null},{"source":"circl","label":"CIRCL","listed":false,"entry":null}]},"ransomware":{"state":"none-recorded","sources":[]},"exploits":[],"exploitCount":0,"weaknesses":[{"id":"CWE-843","name":"Access of Resource Using Incompatible Type ('Type Confusion')","description":"The product allocates or initializes a resource such as a pointer, object, or variable using one type, but it later accesses that resource using a type that is incompatible with the original type.","type":"weakness","status":"Incomplete","abstraction":"Base","likelihoodOfExploit":null,"url":"https://cwe.mitre.org/data/definitions/843.html"}],"affected":[{"vendor":"bytecodealliance","product":"wasmtime","name":"wasmtime","label":"wasmtime","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"≤ 0.29.0","noFixRecorded":false,"fixedIn":null}],"versionsText":"≤ 0.29.0","eol":null,"hubHref":"/vendor/bytecodealliance/wasmtime"}],"affectedCount":1,"eol":{"hasEol":false,"count":0},"references":[{"url":"https://crates.io/crates/wasmtime","label":"crates.io/crates/wasmtime","hostname":"crates.io","tags":["X Refsource MISC"]},{"url":"https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-q879-9g95-56mx","label":"github.com/bytecodealliance/wasmtime/security/advisories/GHSA-q879-9g95-56mx","hostname":"github.com","tags":["X Refsource CONFIRM"]},{"url":"https://github.com/bytecodealliance/wasmtime/commit/b39f087414f27ae40c44449ed5d1154e03449bff","label":"github.com/bytecodealliance/wasmtime/commit/b39f087414f27ae40c44449ed5d1154e03449bff","hostname":"github.com","tags":["X Refsource MISC"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/Z2Z33FTXFQ6EOINVEQIP4DFBG53G5XIY/","label":"lists.fedoraproject.org/archives/…","hostname":"lists.fedoraproject.org","tags":["Vendor Advisory","X Refsource FEDORA"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/WAVBRYDDUIY2ZR3K3FO4BVYJKIMJ5TP7/","label":"lists.fedoraproject.org/archives/…","hostname":"lists.fedoraproject.org","tags":["Vendor Advisory","X Refsource FEDORA"]}],"lineage":{"upstream":[],"downstream":[],"duplicates":[],"related":[]},"timeline":[{"kind":"published","date":"2021-09-17T20:10:13.000Z","label":"Published","detail":"Vulnerability first disclosed.","source":null},{"kind":"modified","date":"2024-08-04T01:58:18.272Z","label":"Last modified","detail":"Vulnerability information updated.","source":null}],"risk":{"score":25,"level":"medium","profile":"Default","thresholds":{"critical":75,"high":50,"medium":25,"low":10}},"meta":{"dataAsOf":"2026-10-21T05:09:28.549Z","stale":false,"partial":false}}