{"id":"CVE-2022-31146","revision":"02116eea92a743faa225e6c70b558d51","records":[{"revision":"02116eea92a743faa225e6c70b558d51","observedAt":"2026-10-24T20:17:25.018+00:00","statement":{"source":"nvd","id":"CVE-2022-31146","aliases":[],"title":"Wasmtime is a standalone runtime for WebAssembly. There is a bug in the Wasmtime's code generator, Cranelift, where functions using reference types may be incorrectly missing metadata required for runtime garbage collection. This means that…","description":"Wasmtime is a standalone runtime for WebAssembly. There is a bug in the Wasmtime's 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'd values, reclaiming them and deallocating them. The function will then subsequently continue to use the values assuming they had not been GC'd, 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.","state":0,"publishedAt":"2022-07-21T04:15:11.937+00:00","modifiedAt":"2026-06-17T04:44:54.013+00:00","affected":[],"metrics":[{"system":"CVSS 3.1 · security-advisories@github.com · Secondary","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:L","score":6.4,"severity":"MEDIUM"},{"system":"CVSS 3.1 · nvd@nist.gov · Primary","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":8.8,"severity":"HIGH"}],"references":["https://github.com/WebAssembly/reference-types","https://github.com/bytecodealliance/wasmtime/","https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-5fhj-g3p3-pq9g"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2022-31146","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Modified","weaknesses":["CWE-416"],"productCriteria":["cpe:2.3:a:bytecodealliance:cranelift-codegen:*:*:*:*:*:rust:*:*","cpe:2.3:a:bytecodealliance:wasmtime:*:*:*:*:*:rust:*:*"],"sourceDates":{"published":"2022-07-21T04:15:11.937","lastModified":"2026-06-17T04:44:54.013"},"relatedAdvisories":[],"note":"NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON."},"key":"nvd:CVE-2022-31146","identifiers":["CVE-2022-31146"]},"retained":false,"historicalAffected":[]}],"coverage":[]}