{"id":"CVE-2022-39394","revision":"a712db5946314c4ba286d7b3c3d9f338","records":[{"revision":"a712db5946314c4ba286d7b3c3d9f338","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2022-39394","aliases":[],"title":"wasmtime_trap_code C API function has out of bounds write vulnerability","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.","state":0,"publishedAt":"2022-11-10T00:00:00+00:00","modifiedAt":"2025-04-23T16:39:05.163+00:00","affected":[{"ecosystem":"Vendor product","name":"wasmtime","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"bytecodealliance\",\n                    \"product\": \"wasmtime\",\n                    \"versions\": [\n                        {\n                            \"version\": \"< 2.0.2\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:L","score":3.8,"severity":"LOW"}],"references":["https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-h84q-m8rr-3v9q","https://github.com/bytecodealliance/wasmtime/commit/087d9d7becf7422b3f872a3bcd5d97bb7ce7ff36"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2022-39394","license":"CVE Program Terms of Use","key":"cve-program:CVE-2022-39394","identifiers":["CVE-2022-39394"]},"retained":false,"historicalAffected":[]}],"coverage":[]}