{"cve":"CVE-2022-39394","nvd":{"published":"2022-11-10T20:15:11.850","modified":"2026-06-17T04:58:16.460","status":"Modified","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.","cvss_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8},"cwes":["CWE-787"],"references":["https://github.com/bytecodealliance/wasmtime/commit/087d9d7becf7422b3f872a3bcd5d97bb7ce7ff36","https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-h84q-m8rr-3v9q","https://github.com/bytecodealliance/wasmtime/commit/087d9d7becf7422b3f872a3bcd5d97bb7ce7ff36","https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-h84q-m8rr-3v9q"],"products":["bytecodealliance:wasmtime"],"source":"nvd","synced_at":"2026-10-19T21:37:08.729216836+00:00"},"epss":{"cve":"CVE-2022-39394","score":0.00354,"percentile":0.29162,"date":"2026-10-31"},"kev":null,"osv":[{"id":"GHSA-h84q-m8rr-3v9q","url":"https://osv.dev/vulnerability/GHSA-h84q-m8rr-3v9q","summary":"wasmtime_trap_code C API function has out of bounds write vulnerability","modified":"2025-05-02T12:51:45Z","packages":[{"ecosystem":"crates.io","name":"wasmtime","purl":"pkg:cargo/wasmtime","ranges":[">=2.0.0 <2.0.2"],"fixed":["2.0.2"]},{"ecosystem":"crates.io","name":"wasmtime","purl":"pkg:cargo/wasmtime","ranges":["<1.0.2"],"fixed":["1.0.2"]}]},{"id":"RUSTSEC-2022-0097","url":"https://osv.dev/vulnerability/RUSTSEC-2022-0097","summary":"Out of bounds write in `wasmtime_trap_code` C API function","modified":"2026-10-12T18:00:06.112472830Z","packages":[{"ecosystem":"crates.io","name":"wasmtime","purl":"pkg:cargo/wasmtime","ranges":[">=0.0.0-0 <1.0.2",">=2.0.0 <2.0.2"],"fixed":["1.0.2","2.0.2"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}