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.
Published: 2022-11-10
Score: 3.8 Low
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Analysis and contextual insights are available on OpenCVE Cloud.

Remediation

No vendor fix or workaround currently provided.

Additional remediation guidance may be available on OpenCVE Cloud.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
EUVD EUVD EUVD-2024-0651 wasmtime_trap_code C API function has out of bounds write vulnerability
Github GHSA Github GHSA GHSA-h84q-m8rr-3v9q wasmtime_trap_code C API function has out of bounds write vulnerability
History

Wed, 23 Apr 2025 17:15:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Subscriptions

Bytecodealliance Wasmtime
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2025-04-23T16:39:05.163Z

Reserved: 2022-09-02T00:00:00.000Z

Link: CVE-2022-39394

cve-icon Vulnrichment

Updated: 2024-08-03T12:07:41.252Z

cve-icon NVD

Status : Modified

Published: 2022-11-10T20:15:11.850

Modified: 2024-11-21T07:18:12.087

Link: CVE-2022-39394

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

No data.

Weaknesses