CVE-2022-39394: wasmtime_trap_code C API function has out of bounds write vulnerability
Vulnerability summary
CVE-2022-39394 is a critical (CVSS 9.8) Out-of-bounds Write vulnerability in bytecodealliance wasmtime. EPSS estimates a 0.43% chance of exploitation in the next 30 days, higher than 39.3% of scored vulnerabilities.
Not severe (CVSS 3.8, local access); no exploitation reported by the 5 checked sources
Source freshness unavailable
How is this decided?Timeline
- 10-11-2022PublishedVulnerability first disclosed.
- 23-04-2025Last modifiedVulnerability information updated.
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 metrics
4 scores · 4 sources · 1 version- CVE.orgCNA3.8LowCVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:LDiffers
- OSV · UbuntuEcosystem advisory · calculated3.8LowCVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:LDiffers
- OSV · Crates.ioEcosystem advisory · calculated3.8LowCVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:LDiffers
EPSS trend
Probability
0.43%
Chance of exploitation in the next 30 days
Percentile
39%
Versus all other CVEs
30-day change
Increase +0.08 pp
From 0.35% on 04-11-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root causeAffected systems
Known conditions: local access, administrative account, user interaction (CVSS vector). Other conditions: not stated in public data.
Ubuntu6 products
- mozjs38All versions (No fix recorded)
- mozjs52All versions (No fix recorded)
- mozjs68All versions (No fix recorded)
- mozjs78All versions (No fix recorded)
- mozjs91All versions (No fix recorded)
Bytecodealliance1 product
- wasmtime< 2.0.2 | < 1.0.2 | ≥ 2.0.0, < 2.0.2
Crates.Io1 product
- wasmtime< 1.0.2 | ≥ 2.0.0, < 2.0.2
3 vendors · 8 products
References
10 links- github.com/bytecodealliance/wasmtime/security/advisories/GHSA-h84q-m8rr-3v9qREPORTWEBThird Party Advisory
- github.com/bytecodealliance/wasmtime/commit/087d9d7becf7422b3f872a3bcd5d97bb7ce7ff36REPORTWEBPatchThird Party Advisory
- crates.io/crates/wasmtimePACKAGE