{"answers":{"affected":"5 open source packages ship an affected version, including wasmtime. It affects 1 product.","exploited":"There is no known exploitation of CVE-2022-39394 in the wild and no public exploit code.","fix":"Upgrade wasmtime to a fixed version for your release line: 1.0.2 or 2.0.2.","what":"CVE-2022-39394 is a low-severity memory corruption vulnerability in bytecodealliance wasmtime, published on 10 Nov 2022. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2022-39394 and fix it if it is affected.\n\nWhat it is: CVE-2022-39394 is a low-severity memory corruption vulnerability in bytecodealliance wasmtime, published on 10 Nov 2022. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of CVE-2022-39394 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- wasmtime (crates.io): affected all versions; fixed in 1.0.2\n- wasmtime (crates.io): affected all versions; fixed in 1.0.2\n- wasmtime (crates.io): affected from 0.0.0-0; fixed in 1.0.2, 2.0.2\n- wasmtime (crates.io): affected from 2.0.0; fixed in 2.0.2\n- wasmtime (crates.io): affected from 2.0.0; fixed in 2.0.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-39394/ (Markdown: https://insights.sbomify.com/CVE-2022-39394/index.md)","id":"CVE-2022-39394","markdown":"https://insights.sbomify.com/CVE-2022-39394/index.md","name":"CVE-2022-39394","record":{"aliases":["GHSA-h84q-m8rr-3v9q","RUSTSEC-2022-0097","UBUNTU-CVE-2022-39394"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution","denial_of_service"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"WebAssembly runtime","requires_auth":"high_privilege","summary":"A memory corruption vulnerability in the Wasmtime C API allows out-of-bounds writes, potentially leading to code execution or crashes.","user_interaction":"required","vuln_class":"memory_corruption"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"wasmtime","vendor":"bytecodealliance"}],"cvss":{"score":3.8,"severity":"low","source":"cna","vector":"CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:L","version":"3.1"},"cwes":[{"id":"CWE-787","name":"Out-of-bounds Write"}],"description":"Wasmtime is a standalone runtime for WebAssembly. Prior to version 2.0.2, there is a bug in Wasmtime's C API implementation where the definition of the `wasmtime_trap_code` does not match its declared signature in the `wasmtime/trap.h` header file. This discrepancy causes the function implementation to perform a 4-byte write into a 1-byte buffer provided by the caller. This can lead to three zero bytes being written beyond the 1-byte location provided by the caller. This bug has been patched and users should upgrade to Wasmtime 2.0.2. This bug can be worked around by providing a 4-byte buffer casted to a 1-byte buffer when calling `wasmtime_trap_code`. Users of the `wasmtime` crate are not affected by this issue, only users of the C API function `wasmtime_trap_code` are affected.","ecosystems":["crates.io"],"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":"wasmtime_trap_code C API function has out of bounds write vulnerability","id":"CVE-2022-39394","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"crates.io","product":null,"products":[],"type":"memory_corruption","year":"2022"},"n_packages":5,"n_references":2,"next":{"headline":"Vela Insecure Defaults","id":"CVE-2022-39395"},"packages":[{"ecosystem":"crates.io","fixed":["1.0.2"],"introduced":["0"],"last_affected":[],"package":"wasmtime","purl":null,"source":"GHSA-h84q-m8rr-3v9q"},{"ecosystem":"crates.io","fixed":["1.0.2"],"introduced":["0"],"last_affected":[],"package":"wasmtime","purl":"pkg:cargo/wasmtime","source":"GHSA-h84q-m8rr-3v9q"},{"ecosystem":"crates.io","fixed":["1.0.2","2.0.2"],"introduced":["0.0.0-0","2.0.0"],"last_affected":[],"package":"wasmtime","purl":"pkg:cargo/wasmtime","source":"RUSTSEC-2022-0097"},{"ecosystem":"crates.io","fixed":["2.0.2"],"introduced":["2.0.0"],"last_affected":[],"package":"wasmtime","purl":null,"source":"GHSA-h84q-m8rr-3v9q"},{"ecosystem":"crates.io","fixed":["2.0.2"],"introduced":["2.0.0"],"last_affected":[],"package":"wasmtime","purl":"pkg:cargo/wasmtime","source":"GHSA-h84q-m8rr-3v9q"}],"prev":{"headline":"Wasmtime vulnerable to data leakage between instances in the pooling allocator","id":"CVE-2022-39393"},"products":["wasmtime"],"published":"2022-11-10","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":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"open","licence":"CC0 1.0","name":"RustSec","prefix":"RUSTSEC"},{"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":"partial"},"state":"PUBLISHED","updated":"2025-04-23","vendors":["bytecodealliance"]},"summary":"A memory corruption vulnerability in the Wasmtime C API allows out-of-bounds writes, potentially leading to code execution or crashes.","url":"https://insights.sbomify.com/CVE-2022-39394/"}