CVE-2022-39394wasmtime_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.
What to do
Fixed builds are available from crates.io: see the table below for the fixed version per release.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 24.04 | firefox | Not affected vulnerable_code_not_present | ||
| Ubuntu 24.04 | thunderbird | Will not fix mozjs contains a copy of the SpiderMonkey JavaScript engine starting with Ubuntu 22.04, the firefox package is just a script that installs the Firefox snap | UBUNTU-CVE-2022-39394 | |
| Ubuntu 22.04 | firefox | Not affected vulnerable_code_not_present | ||
| Ubuntu 22.04 | mozjs78 | Will not fix mozjs contains a copy of the SpiderMonkey JavaScript engine starting with Ubuntu 22.04, the firefox package is just a script that installs the Firefox snap | UBUNTU-CVE-2022-39394 | |
| Ubuntu 22.04 | mozjs91 | Will not fix mozjs contains a copy of the SpiderMonkey JavaScript engine starting with Ubuntu 22.04, the firefox package is just a script that installs the Firefox snap | UBUNTU-CVE-2022-39394 | |
| Ubuntu 22.04 | thunderbird | Will not fix mozjs contains a copy of the SpiderMonkey JavaScript engine starting with Ubuntu 22.04, the firefox package is just a script that installs the Firefox snap | UBUNTU-CVE-2022-39394 | |
| Ubuntu 20.04 | firefox | Will not fix mozjs contains a copy of the SpiderMonkey JavaScript engine starting with Ubuntu 22.04, the firefox package is just a script that installs the Firefox snap | ||
| Ubuntu 20.04 | mozjs52 | Will not fix mozjs contains a copy of the SpiderMonkey JavaScript engine starting with Ubuntu 22.04, the firefox package is just a script that installs the Firefox snap | UBUNTU-CVE-2022-39394 | |
| Ubuntu 20.04 | mozjs68 | Will not fix mozjs contains a copy of the SpiderMonkey JavaScript engine starting with Ubuntu 22.04, the firefox package is just a script that installs the Firefox snap | UBUNTU-CVE-2022-39394 | |
| Ubuntu 20.04 | thunderbird | Will not fix mozjs contains a copy of the SpiderMonkey JavaScript engine starting with Ubuntu 22.04, the firefox package is just a script that installs the Firefox snap | ||
| Ubuntu 18.04 | firefox | Will not fix mozjs contains a copy of the SpiderMonkey JavaScript engine starting with Ubuntu 22.04, the firefox package is just a script that installs the Firefox snap | ||
| Ubuntu 18.04 | mozjs38 | Will not fix mozjs contains a copy of the SpiderMonkey JavaScript engine starting with Ubuntu 22.04, the firefox package is just a script that installs the Firefox snap | UBUNTU-CVE-2022-39394 | |
| Ubuntu 18.04 | mozjs52 | Will not fix mozjs contains a copy of the SpiderMonkey JavaScript engine starting with Ubuntu 22.04, the firefox package is just a script that installs the Firefox snap | UBUNTU-CVE-2022-39394 | |
| Ubuntu 18.04 | thunderbird | Will not fix mozjs contains a copy of the SpiderMonkey JavaScript engine starting with Ubuntu 22.04, the firefox package is just a script that installs the Firefox snap | ||
| Ubuntu 16.04 | firefox | Will not fix mozjs contains a copy of the SpiderMonkey JavaScript engine starting with Ubuntu 22.04, the firefox package is just a script that installs the Firefox snap | ||
| Ubuntu 16.04 | thunderbird | Will not fix mozjs contains a copy of the SpiderMonkey JavaScript engine starting with Ubuntu 22.04, the firefox package is just a script that installs the Firefox snap | ||
| Ubuntu 14.04 | firefox | Will not fix mozjs contains a copy of the SpiderMonkey JavaScript engine starting with Ubuntu 22.04, the firefox package is just a script that installs the Firefox snap | ||
| Ubuntu 14.04 | thunderbird | Will not fix mozjs contains a copy of the SpiderMonkey JavaScript engine starting with Ubuntu 22.04, the firefox package is just a script that installs the Firefox snap | ||
| crates.io library | wasmtime | Fixed | 1.0.2 | GHSA-h84q-m8rr-3v9q |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- bytecodealliance wasmtime: affected: < 2.0.2
References
- https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-h84q-m8rr-3v9q
- https://github.com/bytecodealliance/wasmtime/commit/087d9d7becf7422b3f872a3bcd5d97bb7ce7ff36
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.