{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2022-39394","id":"CVE-2022-39394","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 ","descriptionLong":"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.","published":"2022-11-10T00:00:00.000Z","updated":"2026-10-28T02:30:30.058970501Z","reserved":"2022-09-02T00:00:00.000Z","status":"Modified","rejected":false,"assigner":"GitHub_M","metric":{"version":"3.1","score":3.8,"vector":"CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:L","rating":"low","source":"GitHub_M"},"metrics":[{"version":"3.1","score":3.8,"vector":"CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:L","rating":"low","source":"GitHub_M"},{"version":"3.1","score":3.8,"vector":"CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:L","rating":"low","source":"github.com"},{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","rating":"critical","source":"NVD"},{"version":"3.1","score":3.8,"vector":"CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:L","rating":"low","source":"OSV"},{"version":"3.1","score":3.8,"vector":"CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:L","rating":"low","source":"GitHub"}],"rating":"low","products":["bytecodealliance wasmtime"],"affectedProducts":[{"vendor":"bytecodealliance","product":"wasmtime","defaultStatus":null,"versions":[{"version":"< 2.0.2","status":"affected"}],"platforms":[]}],"packages":[{"ecosystem":"crates.io","name":"wasmtime","purl":"pkg:cargo/wasmtime","ranges":[">=2.0.0 <2.0.2","<1.0.2",">=0.0.0-0 <1.0.2"],"fixed":["2.0.2","1.0.2"],"advisory":"GHSA-h84q-m8rr-3v9q"}],"cwes":["CWE-787"],"aliases":["GHSA-h84q-m8rr-3v9q","RUSTSEC-2022-0097"],"references":[{"url":"https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-h84q-m8rr-3v9q","tags":["x_transferred","Third Party Advisory","advisory","web"]},{"url":"https://github.com/bytecodealliance/wasmtime/commit/087d9d7becf7422b3f872a3bcd5d97bb7ce7ff36","tags":["x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/39xxx/CVE-2022-39394.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-39394","tags":["advisory"]},{"url":"https://github.com/bytecodealliance/wasmtime/commit/5b6d5e78de106503b3b9add218bb3d2b1d63c493","tags":["web"]},{"url":"https://github.com/bytecodealliance/wasmtime","tags":["package"]},{"url":"https://groups.google.com/a/bytecodealliance.org/g/sec-announce/c/c1HBDDJwNPA","tags":["web"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2022-0097.html","tags":["web","advisory"]},{"url":"https://crates.io/crates/wasmtime","tags":["package"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial"},"epss":0.00423,"epssPercentile":0.37337,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2022-39394","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-39394","ok":true,"note":"Modified"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2022-39394","ok":true,"note":"1 package"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-h84q-m8rr-3v9q","ok":true,"note":"GHSA-h84q-m8rr-3v9q"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2022-39394","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}