{"id":"EUVD-2022-6243","enisaUuid":"898495bf-b3ff-35fc-b6ce-a5382684b5d3","description":"Wasmtime is a standalone runtime for WebAssembly. There is a bug in the Wasmtime\u0027s code generator, Cranelift, where functions using reference types may be incorrectly missing metadata required for runtime garbage collection. This means that if a GC happens at runtime then the GC pass will mistakenly think these functions do not have live references to GC\u0027d values, reclaiming them and deallocating them. The function will then subsequently continue to use the values assuming they had not been GC\u0027d, leading later to a use-after-free. This bug was introduced in the migration to the `regalloc2` register allocator that occurred in the Wasmtime 0.37.0 release on 2022-05-20. This bug has been patched and users should upgrade to Wasmtime version 0.38.2. Mitigations for this issue can be achieved by disabling the reference types proposal by passing `false` to `wasmtime::Config::wasm_reference_types` or downgrading to Wasmtime 0.36.0 or prior.","datePublished":"Jul 20, 2022, 10:30:16 PM","dateUpdated":"Apr 23, 2025, 5:57:59 PM","baseScore":6.4,"baseScoreVersion":"3.1","baseScoreVector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:L","references":"https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-5fhj-g3p3-pq9g\nhttps://github.com/WebAssembly/reference-types\nhttps://github.com/bytecodealliance/wasmtime/\n","aliases":"CVE-2022-31146\nGHSA-5fhj-g3p3-pq9g\n","assigner":"GitHub_M","epss":1.25,"enisaIdProduct":[{"id":"432e7f97-7ec9-3a8a-b673-28c6cc9ead92","product":{"name":"wasmtime","vendor":{"name":"bytecodealliance"}},"product_version":"0.84.0, \u003c 0.85.2"},{"id":"9c07c930-f19b-30b4-b8a4-0f9ea63d8b56","product":{"name":"wasmtime","vendor":{"name":"bytecodealliance"}},"product_version":"0.37.0, \u003c 0.38.2"}],"enisaIdVendor":[{"id":"1d773111-65ab-34b1-a8a9-4bfe0f0219e1","vendor":{"name":"bytecodealliance"}}],"enisaIdVulnerability":[{"id":"89846f94-e43d-3ed0-84cc-93b22c837acd","vulnerability":{"id":"GHSA-5fhj-g3p3-pq9g","description":"Wasmtime vulnerable to Use After Free with `externref`s","datePublished":"Jul 20, 2022, 10:47:13 PM","dateUpdated":"May 2, 2025, 12:48:59 PM","baseScore":0.0,"references":"https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-5fhj-g3p3-pq9g\nhttps://nvd.nist.gov/vuln/detail/CVE-2022-31146\nhttps://github.com/bytecodealliance/wasmtime/commit/2ba4bce5cc719e5a74e571a534424614e62ecc41\nhttps://github.com/WebAssembly/reference-types\nhttps://github.com/bytecodealliance/wasmtime\nhttps://rustsec.org/advisories/RUSTSEC-2022-0100.html\n","enisa_id":"EUVD-2022-6243\n","aliases":"GHSA-5fhj-g3p3-pq9g\nCVE-2022-31146\n","epss":0.0,"dataProcessed":"May 3, 2026, 2:05:20 AM","vulnerabilityProduct":[],"vulnerabilityVendor":[]}},{"id":"fe17f99d-ebfd-33d2-a25a-3caa7fae21d3","vulnerability":{"id":"CVE-2022-31146","description":"Wasmtime is a standalone runtime for WebAssembly. There is a bug in the Wasmtime\u0027s code generator, Cranelift, where functions using reference types may be incorrectly missing metadata required for runtime garbage collection. This means that if a GC happens at runtime then the GC pass will mistakenly think these functions do not have live references to GC\u0027d values, reclaiming them and deallocating them. The function will then subsequently continue to use the values assuming they had not been GC\u0027d, leading later to a use-after-free. This bug was introduced in the migration to the `regalloc2` register allocator that occurred in the Wasmtime 0.37.0 release on 2022-05-20. This bug has been patched and users should upgrade to Wasmtime version 0.38.2. Mitigations for this issue can be achieved by disabling the reference types proposal by passing `false` to `wasmtime::Config::wasm_reference_types` or downgrading to Wasmtime 0.36.0 or prior.","datePublished":"Jul 20, 2022, 10:30:16 PM","dateUpdated":"Apr 23, 2025, 5:57:59 PM","status":"PUBLISHED","baseScore":6.4,"baseScoreVersion":"3.1","baseScoreVector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:L","references":"https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-5fhj-g3p3-pq9g\nhttps://github.com/WebAssembly/reference-types\nhttps://github.com/bytecodealliance/wasmtime/\n","enisa_id":"EUVD-2022-6243\n","assigner":"GitHub_M","epss":1.25,"dataProcessed":"Nov 5, 2026, 7:20:48 AM","vulnerabilityProduct":[{"id":"094aa666-df43-4465-b6d5-ee597a7b7617","product":{"name":"wasmtime","vendor":{"name":"bytecodealliance"}},"product_version":"0.37.0, \u003c 0.38.2"},{"id":"108e0530-9358-3c98-b698-d2e53481e4f5","product":{"name":"wasmtime","vendor":{"name":"bytecodealliance"}},"product_version":"0.37.0, \u003c 0.38.2"},{"id":"af0f8b09-7015-4598-90ba-1cb11f291913","product":{"name":"wasmtime","vendor":{"name":"bytecodealliance"}},"product_version":"0.84.0, \u003c 0.85.2"},{"id":"f599a6cd-e184-34c8-9900-3dfb91439d4d","product":{"name":"wasmtime","vendor":{"name":"bytecodealliance"}},"product_version":"0.84.0, \u003c 0.85.2"}],"vulnerabilityVendor":[{"id":"2d98209a-b15a-3ecd-8b71-1e56e0210a82","vendor":{"name":"bytecodealliance"}}]}}],"enisaIdAdvisory":[{"id":"05211894-ef84-357a-b302-099efdd597a4","advisory":{"id":"msrc_CVE-2022-31146","description":"Use after free in Wasmtime","datePublished":"Sep 3, 2025, 8:11:45 PM","dateUpdated":"Feb 18, 2026, 2:18:01 PM","baseScore":0.0,"references":"https://msrc.microsoft.com/csaf/vex/2022/msrc_cve-2022-31146.json\n","aliases":"CVE-2022-31146\n","source":{"id":20,"name":"csaf_microsoft"},"advisoryProduct":[{"id":"8d62ad67-bb8c-3e5f-8850-97ac4c431987","product":{"name":"Azure Linux","vendor":{"name":"Microsoft"}}},{"id":"8f70a69d-77b1-3ce1-8afe-844154bef063","product":{"name":"azl3 mozjs 0:102.15.1-1.azl3","vendor":{"name":"Microsoft"}}},{"id":"ba7eb176-5131-3c20-8689-d39f255780b0","product":{"name":"3.0","vendor":{"name":"Wind River"}}},{"id":"d9f42ddb-32c3-315d-8532-432537dcb2d4","product":{"name":"azl3 rust 0:1.75.0-14.azl3","vendor":{"name":"Microsoft"}}},{"id":"e0447b39-a508-31a6-8e97-d35bea08ebc9","product":{"name":"azl3 rust 0:1.86.0-1.azl3","vendor":{"name":"Microsoft"}}}]}}]}