{"answers":{"affected":"6 open source packages ship an affected version, including wasmtime. It affects 1 product.","exploited":"There is no known exploitation of CVE-2022-24791 in the wild and no public exploit code.","fix":"Upgrade wasmtime to a fixed version for your release line: 0.34.2 or 0.35.2.","what":"CVE-2022-24791 is a high-severity use after free vulnerability in bytecodealliance wasmtime, published on 31 Mar 2022. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2022-24791 and fix it if it is affected.\n\nWhat it is: CVE-2022-24791 is a high-severity use after free vulnerability in bytecodealliance wasmtime, published on 31 Mar 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2022-24791 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- wasmtime (crates.io): affected all versions; fixed in 0.34.2\n- wasmtime (crates.io): affected all versions; fixed in 0.34.2\n- wasmtime (crates.io): affected from 0.0.0-0; fixed in 0.34.2, 0.35.2\n- wasmtime (crates.io): affected from 0.34.0; fixed in 0.34.2, 0.35.2\n- wasmtime (crates.io): affected from 0.35.0; fixed in 0.35.2\n- wasmtime (crates.io): affected from 0.35.0; fixed in 0.35.2\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2022-24791/ (Markdown: https://insights.sbomify.com/CVE-2022-24791/index.md)","id":"CVE-2022-24791","markdown":"https://insights.sbomify.com/CVE-2022-24791/index.md","name":"CVE-2022-24791","record":{"aliases":["GHSA-gwc9-348x-qwv2","RUSTSEC-2022-0016","RUSTSEC-2022-0099","UBUNTU-CVE-2022-24791","openSUSE-SU-2024:12009-1"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution","denial_of_service"],"network_reachable":"yes","non_default_config":true,"product_category":"WebAssembly runtime","requires_auth":"none","summary":"Attackers can trigger a use-after-free in Wasmtime by exploiting missing stack maps during garbage collection, potentially leading to code execution or crashes.","user_interaction":"not_required","vuln_class":"use_after_free"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"wasmtime","vendor":"bytecodealliance"}],"cvss":{"score":8.1,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-416","name":"Use After Free"}],"description":"Wasmtime is a standalone JIT-style runtime for WebAssembly, using Cranelift. There is a use after free vulnerability in Wasmtime when both running Wasm that uses externrefs and enabling epoch interruption in Wasmtime. If you are not explicitly enabling epoch interruption (it is disabled by default) then you are not affected. If you are explicitly disabling the Wasm reference types proposal (it is enabled by default) then you are also not affected. The use after free is caused by Cranelift failing to emit stack maps when there are safepoints inside cold blocks. Cold blocks occur when epoch interruption is enabled. Cold blocks are emitted at the end of compiled functions, and change the order blocks are emitted versus defined. This reordering accidentally caused Cranelift to skip emitting some stack maps because it expected to emit the stack maps in block definition order, rather than block emission order. When Wasmtime would eventually collect garbage, it would fail to find live references on the stack because of the missing stack maps, think that they were unreferenced garbage, and therefore reclaim them. Then after the collection ended, the Wasm code could use the reclaimed-too-early references, which is a use after free. Patches have been released in versions 0.34.2 and 0.35.2, which fix the vulnerability. All Wasmtime users are recommended to upgrade to these patched versions. If upgrading is not an option for you at this time, you can avoid the vulnerability by either: disabling the Wasm reference types proposal, config.wasm_reference_types(false); or by disabling epoch interruption if you were previously enabling it. config.epoch_interruption(false).","ecosystems":["crates.io","openSUSE:Tumbleweed"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Use after free in Wasmtime","id":"CVE-2022-24791","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"crates.io","product":null,"products":[],"type":"use_after_free","year":"2022"},"n_packages":7,"n_references":2,"next":{"headline":"Potential infinite loop when parsing WAV format file in PJSIP","id":"CVE-2022-24792"},"packages":[{"ecosystem":"crates.io","fixed":["0.34.2"],"introduced":["0"],"last_affected":[],"package":"wasmtime","purl":null,"source":"GHSA-gwc9-348x-qwv2"},{"ecosystem":"crates.io","fixed":["0.34.2"],"introduced":["0"],"last_affected":[],"package":"wasmtime","purl":"pkg:cargo/wasmtime","source":"GHSA-gwc9-348x-qwv2"},{"ecosystem":"crates.io","fixed":["0.34.2","0.35.2"],"introduced":["0.0.0-0","0.35.0"],"last_affected":[],"package":"wasmtime","purl":"pkg:cargo/wasmtime","source":"RUSTSEC-2022-0099"},{"ecosystem":"crates.io","fixed":["0.34.2","0.35.2"],"introduced":["0.34.0","0.35.0"],"last_affected":[],"package":"wasmtime","purl":"pkg:cargo/wasmtime","source":"RUSTSEC-2022-0016"},{"ecosystem":"crates.io","fixed":["0.35.2"],"introduced":["0.35.0"],"last_affected":[],"package":"wasmtime","purl":null,"source":"GHSA-gwc9-348x-qwv2"},{"ecosystem":"crates.io","fixed":["0.35.2"],"introduced":["0.35.0"],"last_affected":[],"package":"wasmtime","purl":"pkg:cargo/wasmtime","source":"GHSA-gwc9-348x-qwv2"},{"ecosystem":"openSUSE:Tumbleweed","fixed":["20220420-1.1"],"introduced":["0"],"last_affected":[],"package":"cargo-audit-advisory-db","purl":"pkg:rpm/opensuse/cargo-audit-advisory-db\u0026distro=openSUSE%20Tumbleweed","source":"openSUSE-SU-2024:12009-1"}],"prev":{"headline":"HTTP Request Smuggling in puma","id":"CVE-2022-24790"},"products":["wasmtime"],"published":"2022-03-31","related":[{"cvss_score":9,"headline":"Wasmtime miscompiled guest heap access enables sandbox escape on aarch64 Cranelift","id":"CVE-2026-34971","kev_date_added":null,"published":"2026-04-09"},{"cvss_score":9,"headline":"Wasmtime with Winch compiler backend on aarch64 may allow a sandbox-escaping memory access","id":"CVE-2026-34987","kev_date_added":null,"published":"2026-04-09"},{"cvss_score":8.6,"headline":"Wasmtime vulnerable to data leakage between instances in the pooling allocator","id":"CVE-2022-39393","kev_date_added":null,"published":"2022-11-10"},{"cvss_score":7.5,"headline":"Wasmtime: WASI path_open(TRUNCATE) bypasses `FilePerms::WRITE` host restriction","id":"CVE-2026-47261","kev_date_added":null,"published":"2026-06-15"},{"cvss_score":6.9,"headline":"Wasmtime has a Heap OOB read in component model UTF-16 to latin1+utf16 string transcoding","id":"CVE-2026-34941","kev_date_added":null,"published":"2026-04-09"},{"cvss_score":6.9,"headline":"Wasmtime is vulnerable to panic when dropping a `[Typed]Func::call_async` future","id":"CVE-2026-27195","kev_date_added":null,"published":"2026-02-24"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"open","licence":"CC0 1.0","name":"RustSec","prefix":"RUSTSEC"},{"class":"attribution","licence":"CC BY 4.0","name":"SUSE","prefix":"openSUSE"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"total"},"state":"PUBLISHED","updated":"2025-04-23","vendors":["bytecodealliance"]},"summary":"Attackers can trigger a use-after-free in Wasmtime by exploiting missing stack maps during garbage collection, potentially leading to code execution or crashes.","url":"https://insights.sbomify.com/CVE-2022-24791/"}