{"schemaVersion":4,"id":"CVE-2021-39219","aliases":[],"status":"published","duplicateOf":null,"title":"Wrong type for `Linker`-define functions when used across two `Engine`s","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.31918,"severity":"low","asOf":"2026-12-04T00:00:00.000Z","change":{"pp":0,"baselineDate":"2026-11-04T00: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":null},{"date":"2026-10-21T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-22T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-23T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-24T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-25T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-26T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-27T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-28T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-29T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-30T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-10-31T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-01T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-02T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-03T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-04T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-05T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-06T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-07T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-08T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-09T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-10T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-11T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-12T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-13T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-14T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-15T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-16T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-17T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-18T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-19T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-20T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-21T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-22T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-23T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-24T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-25T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-26T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-27T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-28T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-29T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-30T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-12-01T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-12-02T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-12-03T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-12-04T00:00:00.000Z","score":0.00361,"percentile":0.31918}],"last30":[{"date":"2026-11-04T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-05T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-06T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-07T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-08T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-09T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-10T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-11T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-12T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-13T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-14T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-15T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-16T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-17T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-18T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-19T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-20T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-21T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-22T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-23T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-24T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-25T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-26T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-27T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-28T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-29T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-11-30T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-12-01T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-12-02T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-12-03T00:00:00.000Z","score":0.00361,"percentile":null},{"date":"2026-12-04T00:00:00.000Z","score":0.00361,"percentile":0.31918}]},"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","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,"bounds":{"kind":"range","start":null,"startInclusive":true,"end":"0.29.0","endInclusive":true}}],"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}],"priority":{"label":"routine","tag":null,"reason":"Not severe (CVSS 6.3, local access); no exploitation reported by the 5 checked sources","nextStep":"Fix in the normal cadence","rank":[0,0,0,0,0,63],"checkedSources":["cisa","enisa","circl","shadowserver","cisa-adp"],"evidence":[{"type":"epss","source":"FIRST","date":"2026-12-04T00:00:00.000Z","status":"valid","statusDate":null,"statusSource":null,"disputes":[],"value":0.00361,"stale":false,"promoted":null},{"type":"cvss","source":"cve.org","date":"2024-08-04T01:58:18.272Z","status":"valid","statusDate":null,"statusSource":null,"disputes":[],"score":6.3,"vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:H","version":"3.1","headline":true}],"epss":{"value":0.00361,"date":"2026-12-04T00:00:00.000Z","stale":false,"promoted":null},"sources":[{"id":"cisa","lastSuccessfulSync":"2026-12-05T12:01:28.220Z","state":"fresh"},{"id":"enisa","lastSuccessfulSync":"2026-12-05T12:01:28.725Z","state":"fresh"},{"id":"circl","lastSuccessfulSync":"2026-12-05T12:01:28.919Z","state":"fresh"},{"id":"shadowserver","lastSuccessfulSync":null,"state":"unavailable"},{"id":"cisa-adp","lastSuccessfulSync":"2026-12-05T12:01:03.802Z","state":"fresh"},{"id":"epss","lastSuccessfulSync":"2026-12-05T12:01:26.562Z","state":"fresh"},{"id":"osv","lastSuccessfulSync":"2026-12-05T12:01:25.560Z","state":"fresh"}],"feedEvent":null},"meta":{"dataAsOf":"2026-12-05T12:36:54.554Z","stale":false,"partial":false}}