Vulnerability Details : CVE-2022-39394
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.
Vulnerability category: Memory Corruption
Products affected by CVE-2022-39394
- cpe:2.3:a:bytecodealliance:wasmtime:*:*:*:*:*:rust:*:*
- cpe:2.3:a:bytecodealliance:wasmtime:*:*:*:*:*:rust:*:*
Exploit prediction scoring system (EPSS) score for CVE-2022-39394
0.21%
Probability of exploitation activity in the next 30 days
EPSS Score History
~ 59 %
Percentile, the proportion of vulnerabilities that are scored at or less
CVSS scores for CVE-2022-39394
Base Score | Base Severity | CVSS Vector | Exploitability Score | Impact Score | Score Source | First Seen |
---|---|---|---|---|---|---|
9.8
|
CRITICAL | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
3.9
|
5.9
|
NIST | |
3.8
|
LOW | CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:L |
0.3
|
3.4
|
GitHub, Inc. |
CWE ids for CVE-2022-39394
-
The product writes data past the end, or before the beginning, of the intended buffer.Assigned by:
- nvd@nist.gov (Primary)
- security-advisories@github.com (Secondary)
References for CVE-2022-39394
-
https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-h84q-m8rr-3v9q
Out of bounds write in `wasmtime_trap_code` C API function · Advisory · bytecodealliance/wasmtime · GitHubThird Party Advisory
-
https://github.com/bytecodealliance/wasmtime/commit/087d9d7becf7422b3f872a3bcd5d97bb7ce7ff36
Merge pull request from GHSA-h84q-m8rr-3v9q · bytecodealliance/wasmtime@087d9d7 · GitHubPatch;Third Party Advisory
Jump to