{"schemaVersion":3,"id":"CVE-2022-39394","aliases":["UBUNTU-CVE-2022-39394","GHSA-h84q-m8rr-3v9q","RUSTSEC-2022-0097"],"status":"published","duplicateOf":null,"title":null,"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.","dates":{"published":"2022-11-10T00:00:00.000Z","modified":"2025-04-23T16:39:05.163Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":9.8,"severity":"critical","version":"3.1","versionLabel":"v3.1","source":"NVD","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","computed":false,"selection":"backend-summary"},"metrics":[{"version":"3.1","versionLabel":"v3.1","source":"CVE.org","score":3.8,"severity":"low","vector":"CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:L","exploitability":null,"impact":null,"computed":false},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Ubuntu","score":3.8,"severity":"low","vector":"CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:L","exploitability":0.8,"impact":5.7,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Crates.io","score":3.8,"severity":"low","vector":"CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:L","exploitability":0.8,"impact":5.7,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"NVD","score":9.8,"severity":"critical","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","exploitability":null,"impact":null,"computed":false}]},"epss":{"probability":0.00354,"percentile":0.27702,"severity":"low","asOf":"2026-10-20T00:00:00.000Z","change":{"pp":0.012000000000000031,"baselineDate":"2026-09-20T00:00:00.000Z","baselineScore":0.00342},"history":[{"date":"2026-09-14T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-09-15T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-09-16T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-09-17T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-09-18T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-09-19T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.00354,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.00354,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.00354,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.00354,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.00354,"percentile":0.27702}],"last30":[{"date":"2026-09-20T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.00342,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.00354,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.00354,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.00354,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.00354,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.00354,"percentile":0.27702}]},"kev":{"state":"not-listed","entries":[],"listedCount":0,"totalCatalogs":3,"catalogs":[{"source":"cisa","label":"CISA","listed":false,"entry":null},{"source":"enisa","label":"ENISA","listed":false,"entry":null},{"source":"circl","label":"CIRCL","listed":false,"entry":null}]},"ransomware":{"state":"none-recorded","sources":[]},"exploits":[],"exploitCount":0,"weaknesses":[{"id":"CWE-787","name":"Out-of-bounds Write","description":"The product writes data past the end, or before the beginning, of the intended buffer.","type":"weakness","status":"Draft","abstraction":"Base","likelihoodOfExploit":"High","url":"https://cwe.mitre.org/data/definitions/787.html"}],"affected":[{"vendor":"bytecodealliance","product":"wasmtime","name":"wasmtime","label":"wasmtime","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"< 2.0.2","noFixRecorded":false,"fixedIn":null},{"text":"< 1.0.2","noFixRecorded":false,"fixedIn":null},{"text":"≥ 2.0.0, < 2.0.2","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 2.0.2 | < 1.0.2 | ≥ 2.0.0, < 2.0.2","eol":null,"hubHref":"/vendor/bytecodealliance/wasmtime"},{"vendor":"Crates.Io","product":"wasmtime","name":"wasmtime","label":"wasmtime","ecosystem":"Crates.Io","cpePart":null,"purl":"pkg:cargo/wasmtime","purlType":"cargo","versions":[{"text":"< 1.0.2","noFixRecorded":false,"fixedIn":null},{"text":"≥ 2.0.0, < 2.0.2","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 1.0.2 | ≥ 2.0.0, < 2.0.2","eol":null,"hubHref":null},{"vendor":"ubuntu","product":"mozjs38","name":"mozjs38","label":"mozjs38","ecosystem":"Ubuntu","cpePart":null,"purl":"pkg:deb/ubuntu/mozjs38","purlType":"deb","versions":[{"text":"All versions","noFixRecorded":true,"fixedIn":null}],"versionsText":"All versions (No fix recorded)","eol":null,"hubHref":null},{"vendor":"ubuntu","product":"mozjs52","name":"mozjs52","label":"mozjs52","ecosystem":"Ubuntu","cpePart":null,"purl":"pkg:deb/ubuntu/mozjs52","purlType":"deb","versions":[{"text":"All versions","noFixRecorded":true,"fixedIn":null}],"versionsText":"All versions (No fix recorded)","eol":null,"hubHref":null},{"vendor":"ubuntu","product":"mozjs68","name":"mozjs68","label":"mozjs68","ecosystem":"Ubuntu","cpePart":null,"purl":"pkg:deb/ubuntu/mozjs68","purlType":"deb","versions":[{"text":"All versions","noFixRecorded":true,"fixedIn":null}],"versionsText":"All versions (No fix recorded)","eol":null,"hubHref":null},{"vendor":"ubuntu","product":"mozjs78","name":"mozjs78","label":"mozjs78","ecosystem":"Ubuntu","cpePart":null,"purl":"pkg:deb/ubuntu/mozjs78","purlType":"deb","versions":[{"text":"All versions","noFixRecorded":true,"fixedIn":null}],"versionsText":"All versions (No fix recorded)","eol":null,"hubHref":null},{"vendor":"ubuntu","product":"mozjs91","name":"mozjs91","label":"mozjs91","ecosystem":"Ubuntu","cpePart":null,"purl":"pkg:deb/ubuntu/mozjs91","purlType":"deb","versions":[{"text":"All versions","noFixRecorded":true,"fixedIn":null}],"versionsText":"All versions (No fix recorded)","eol":null,"hubHref":null},{"vendor":"ubuntu","product":"thunderbird","name":"thunderbird","label":"thunderbird","ecosystem":"Ubuntu","cpePart":null,"purl":"pkg:deb/ubuntu/thunderbird","purlType":"deb","versions":[{"text":"All versions","noFixRecorded":true,"fixedIn":null}],"versionsText":"All versions (No fix recorded)","eol":null,"hubHref":null}],"affectedCount":8,"eol":{"hasEol":false,"count":0},"references":[{"url":"https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-h84q-m8rr-3v9q","label":"github.com/bytecodealliance/wasmtime/security/advisories/GHSA-h84q-m8rr-3v9q","hostname":"github.com","tags":["REPORT","WEB","Third Party Advisory"]},{"url":"https://github.com/bytecodealliance/wasmtime/commit/087d9d7becf7422b3f872a3bcd5d97bb7ce7ff36","label":"github.com/bytecodealliance/wasmtime/commit/087d9d7becf7422b3f872a3bcd5d97bb7ce7ff36","hostname":"github.com","tags":["REPORT","WEB","Patch","Third Party Advisory"]},{"url":"https://ubuntu.com/security/CVE-2022-39394","label":"ubuntu.com/security/CVE-2022-39394","hostname":"ubuntu.com","tags":["REPORT"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2022-39394","label":"www.cve.org/CVERecord?id=CVE-2022-39394","hostname":"www.cve.org","tags":["REPORT"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-39394","label":"nvd.nist.gov/vuln/detail/CVE-2022-39394","hostname":"nvd.nist.gov","tags":["Advisory"]},{"url":"https://github.com/bytecodealliance/wasmtime/commit/5b6d5e78de106503b3b9add218bb3d2b1d63c493","label":"github.com/bytecodealliance/wasmtime/commit/5b6d5e78de106503b3b9add218bb3d2b1d63c493","hostname":"github.com","tags":["WEB"]},{"url":"https://github.com/bytecodealliance/wasmtime","label":"github.com/bytecodealliance/wasmtime","hostname":"github.com","tags":["PACKAGE"]},{"url":"https://groups.google.com/a/bytecodealliance.org/g/sec-announce/c/c1HBDDJwNPA","label":"groups.google.com/a/bytecodealliance.org/g/sec-announce/c/c1HBDDJwNPA","hostname":"groups.google.com","tags":["WEB"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2022-0097.html","label":"rustsec.org/advisories/RUSTSEC-2022-0097.html","hostname":"rustsec.org","tags":["WEB","Advisory"]},{"url":"https://crates.io/crates/wasmtime","label":"crates.io/crates/wasmtime","hostname":"crates.io","tags":["PACKAGE"]}],"lineage":{"upstream":[],"downstream":[],"duplicates":[],"related":[]},"timeline":[{"kind":"published","date":"2022-11-10T00:00:00.000Z","label":"Published","detail":"Vulnerability first disclosed.","source":null},{"kind":"modified","date":"2025-04-23T16:39:05.163Z","label":"Last modified","detail":"Vulnerability information updated.","source":null}],"risk":{"score":70,"level":"high","profile":"Default","thresholds":{"critical":75,"high":50,"medium":25,"low":10}},"meta":{"dataAsOf":"2026-10-20T22:47:42.235Z","stale":false,"partial":false}}