{"answers":{"affected":"It affects 2 products.","exploited":"There is no known exploitation of CVE-2021-39216 in the wild and no public exploit code.","fix":"Upgrade to a fixed version.","what":"CVE-2021-39216 is a medium-severity use after free vulnerability in Fedoraproject Fedora, published on 17 Sep 2021. It can only be exploited from the same machine or local network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2021-39216 and fix it if it is affected.\n\nWhat it is: CVE-2021-39216 is a medium-severity use after free vulnerability in Fedoraproject Fedora, published on 17 Sep 2021. It can only be exploited from the same machine or local network, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2021-39216 in the wild and no public exploit code.\n\nAffected product: Fedoraproject Fedora. No package-level version data is available, so check the vendor advisory linked from the reference page.\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-2021-39216/ (Markdown: https://insights.sbomify.com/CVE-2021-39216/index.md)","id":"CVE-2021-39216","markdown":"https://insights.sbomify.com/CVE-2021-39216/index.md","name":"CVE-2021-39216","record":{"aliases":[],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"WebAssembly runtime","requires_auth":"low_privilege","summary":"A use-after-free vulnerability in Wasmtime allows attackers to execute arbitrary code by passing multiple externrefs from host to guest Wasm.","user_interaction":"not_required","vuln_class":"use_after_free"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"wasmtime","vendor":"bytecodealliance"},{"product":"fedora","vendor":"fedoraproject"}],"cvss":{"score":6.3,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-416","name":"Use After Free"}],"description":"Wasmtime is an open source runtime for WebAssembly \u0026 WASI. In Wasmtime from version 0.19.0 and before version 0.30.0 there was a use-after-free bug when passing `externref`s from the host to guest Wasm content. To trigger the bug, you have to explicitly pass multiple `externref`s from the host to a Wasm instance at the same time, either by passing multiple `externref`s as arguments from host code to a Wasm function, or returning multiple `externref`s to Wasm from a multi-value return function defined in the host. If you do not have host code that matches one of these shapes, then you are not impacted. If Wasmtime's `VMExternRefActivationsTable` became filled to capacity after passing the first `externref` in, then passing in the second `externref` could trigger a garbage collection. However the first `externref` is not rooted until we pass control to Wasm, and therefore could be reclaimed by the collector if nothing else was holding a reference to it or otherwise keeping it alive. Then, when control was passed to Wasm after the garbage collection, Wasm could use the first `externref`, which at this point has already been freed. We have reason to believe that the effective impact of this bug is relatively small because usage of `externref` is currently quite rare. The bug has been fixed, and users should upgrade to Wasmtime 0.30.0. If you cannot upgrade Wasmtime yet, you can avoid the bug by disabling reference types support in Wasmtime by passing `false` to `wasmtime::Config::wasm_reference_types`.","ecosystems":[],"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 passing `externref`s to Wasm in Wasmtime","id":"CVE-2021-39216","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":null,"product":"fedoraproject:fedora","products":["fedoraproject:fedora"],"type":"use_after_free","year":"2021"},"n_packages":0,"n_references":5,"next":{"headline":"OpenMage LTS arbitrary command execution in custom layout update through blocks","id":"CVE-2021-39217"},"packages":[],"prev":{"headline":"Authentication Bypass: Forged Tokens Allow Access to Arbitrary Rooms","id":"CVE-2021-39215"},"products":["wasmtime"],"published":"2021-09-17","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":8.1,"headline":"Use after free in Wasmtime","id":"CVE-2022-24791","kev_date_added":null,"published":"2022-03-31"},{"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":"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":null,"exploitation":null,"technical_impact":null},"state":"PUBLISHED","updated":"2024-08-04","vendors":["bytecodealliance"]},"summary":"A use-after-free vulnerability in Wasmtime allows attackers to execute arbitrary code by passing multiple externrefs from host to guest Wasm.","url":"https://insights.sbomify.com/CVE-2021-39216/"}