cve.bz

CVE-2022-39394 bytecodealliance wasmtime: Out-of-bounds Write

9.8 criticalEPSS 0.4%Fix available

Critical (9.8) in bytecodealliance wasmtime. EPSS 0.4% estimated probability of exploitation activity in the next 30 days. Fixed in wasmtime 1.0.2, 2.0.2.

On this page
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.

Severity

CVSS 3.1

9.8 critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS
0.4% (unchanged from 0.4% a week ago; 0.4% 30 days ago) estimated probability of exploitation activity in the next 30 days; 37th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: partial, assessed 2025-04-23. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-787 Out-of-bounds Write
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2022-39394 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2022-39394?via=ask-ai-copy and https://cve.bz/cve/CVE-2022-39394?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2022-39394 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
bytecodealliance:wasmtimebefore 1.0.2
bytecodealliance:wasmtimefrom 2.0.0 before 2.0.2

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-h84q-m8rr-3v9qcrates.iowasmtime>=2.0.0 <2.0.22.0.2
GHSA-h84q-m8rr-3v9qcrates.iowasmtime<1.0.21.0.2
RUSTSEC-2022-0097crates.iowasmtime>=0.0.0-0 <1.0.2
>=2.0.0 <2.0.2
1.0.2, 2.0.2

Linux distributions

DistributionReleasePackageFixed inAdvisory
Ubuntu18.04:LTSmozjs38, mozjs52no fix listedUBUNTU-CVE-2022-39394
Ubuntu20.04:LTSmozjs52, mozjs68no fix listedUBUNTU-CVE-2022-39394
Ubuntu22.04:LTSmozjs78, mozjs91, thunderbirdno fix listedUBUNTU-CVE-2022-39394
Ubuntu24.04:LTSthunderbirdno fix listedUBUNTU-CVE-2022-39394

From the distributions' data via OSV.dev: Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Ubuntu.

References

Check your stackJSON