CVE-2022-39394 | wasmtime_trap_code C API function has out of bounds write vulnerability

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-10 Last update: 2026-06-17 Assigner: [email protected] Source: [email protected]

Conclusion & alert: CVE-2022-39394 is rated Low Risk (35.3/100): CVSS Low severity, with medium exploitation likelihood (EPSS 0.34%). Mandatory action: Monitor for updates and reassess as exploit intelligence or EPSS changes.

Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.

Exploit prediction scoring system (EPSS) score for CVE-2022-39394

EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).

# Date Old EPSS score New EPSS score Delta (New - Old)
1 2026-06-10 0.11% 0.34% +0.22%
2 2025-11-21 0.17% 0.11% -0.05%
3 2025-11-14 0.17%

Full EPSS history (15 records total)

Common vulnerability scoring system (CVSS) metrics for CVE-2022-39394

CVSS metrics for this CVE.

Base score Version Severity Vector Exploitability Impact Score source
3.8 3.1 LOW
CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:L Click to expand
Attack vector (AV:L)
They already need access on the box, or another person has to do something wrong; it’s not a remote drive-by.
Attack complexity (AC:H)
Even with access, the exploit needs extra luck, timing, or a fussy environment to actually work.
Privileges required (PR:H)
They need powerful rights—admin, root, or similar—before this pays off.
User interaction (UI:R)
A real person has to do something—click, install, enable—otherwise it doesn’t land.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:L)
Some sensitive info could get out, but not a total data dump.
Integrity (I:L)
Attackers could change some data, but it’s limited—not everything goes.
Availability (A:L)
Might cause slowdowns, glitches, or partial disruption—not a full brick.
0.3 3.4 [email protected]
9.8 3.1 CRITICAL
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
3.9 5.9 [email protected]

Weakness enumeration for CVE-2022-39394

GitHub Security Advisory for CVE-2022-39394

GHSA-h84q-m8rr-3v9q · Severity: low · Ecosystem: rust — wasmtime_trap_code C API function has out of bounds write vulnerability

OS Trackers for CVE-2022-39394

vendor priority summary link
debian unimportant CVE-2022-39394 unimportant priority: Debian including 1 source packages (rust-wasmtime), 3 status rows across 3 suites (forky, sid, trixie): resolved 3. https://security-tracker.debian.org/tracker/CVE-2022-39394
ubuntu medium CVE-2022-39394 medium priority: Ubuntu including 7 source packages (firefox, mozjs38, …), 58 status rows across 10 suites (bionic, focal, jammy, kinetic, lunar, mantic, noble, trusty, upstream, xenial): DNE 27, ignored 24, not-affected 5, needs-triage 2. https://ubuntu.com/security/CVE-2022-39394

Affected software / configurations for CVE-2022-39394

Vendor Product Version Raw CPE
bytecodealliance wasmtime < 1.0.2 cpe:2.3:a:bytecodealliance:wasmtime:*:*:*:*:*:rust:*:*
bytecodealliance wasmtime >= 2.0.0, < 2.0.2 cpe:2.3:a:bytecodealliance:wasmtime:*:*:*:*:*:rust:*:*

References for CVE-2022-39394

cvelogic Threat Intelligence