CVE-2022-31104: Miscompilation of `i8x16.swizzle` and `select` with v128 inputs in Wasmtime
Noroxi assessment
Priority: Monitor (action score 23/100)
- The sources we track (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) show no public exploit code or exploitation in the wild.
- Probability of exploitation in the next 30 days: 1.7% (FIRST EPSS); higher than 78.4% of all records.
- Anyone who can reach it over the internet can trigger it. No account or password is required. No user action is required. Special conditions such as timing or configuration are required.
- Fixed version: cranelift-codegen (crates.io) 0.85.1; wasmtime (crates.io) 0.38.1.
Low priority for now. Upgrade to cranelift-codegen (crates.io) 0.85.1; wasmtime (crates.io) 0.38.1 or later.
Generated automatically from the record's data: CVSS (NVD and CNA), CISA KEV and SSVC, FIRST EPSS, exploit sources, fixed versions. How we calculate it
Primary sources: NVD · CVE.org · FIRST EPSS
Wasmtime is a standalone runtime for WebAssembly. In affected versions wasmtime's implementation of the SIMD proposal for WebAssembly on x86_64 contained two distinct bugs in the instruction lowerings implemented in Cranelift. The aarch64 implementation of the simd proposal is not affected. The bugs were presented in the `i8x16.swizzle` and `select` WebAssembly instructions. The `select` instruction is only affected when the inputs are of `v128` type. The correspondingly affected Cranelift instructions were `swizzle` and `select`. The `swizzle` instruction lowering in Cranelift erroneously overwrote the mask input register which could corrupt a constant value, for example. This means that future uses of the same constant may see a different value than the constant itself. The `select` instruction lowering in Cranelift wasn't correctly implemented for vector types that are 128-bits wide. When the condition was 0 the wrong instruction was used to move the correct input to the output of the instruction meaning that only the low 32 bits were moved and the upper 96 bits of the result were left as whatever the register previously contained (instead of the input being moved from). The `select` instruction worked correctly if the condition was nonzero, however. This bug in Wasmtime's implementation of these instructions on x86_64 represents an incorrect implementation of the specified semantics of these instructions according to the WebAssembly specification. The impact of this is benign for hosts running WebAssembly but represents possible vulnerabilities within the execution of a guest program. For example a WebAssembly program could take unintended branches or materialize incorrect values internally which runs the risk of exposing the program itself to other related vulnerabilities which can occur from miscompilations. We have released Wasmtime 0.38.1 and cranelift-codegen (and other associated cranelift crates) 0.85.1 which contain the corrected implementations of these two instructions in Cranelift. If upgrading is not an option for you at this time, you can avoid the vulnerability by disabling the Wasm simd proposal. Additionally the bug is only present on x86_64 hosts. Other aarch64 hosts are not affected. Note that s390x hosts don't yet implement the simd proposal and are not affected.
- Published
- Jun 27, 2022
- Updated
- Jun 17, 2026
- EPSS
- 1.7% · 78th percentile
- CWE
- CWE-682
Report tools
Action score
23
Monitor
Low priority for now.
- CVSS
- 22 / 40 · 5.6 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 1 / 30 · 1.7%
CISA SSVC decision
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
Vulnrichment: CISA's decision-tree inputs.
CNA vs NVD score
- NVD
- 5.6
- CNA · GitHub_M
- 4.8
- 0.8 point gap
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:L
The score given by the assigning authority versus NVD’s independent score. A gap means the severity is contested.
Get told when this record changes
- Not in KEV: no record of exploitation in the wild
- No public exploit code on record
- A fix has been released
If any of these changes, we'll tell you in the daily email digest.
Running WordPress? Scan your site free with WP Lens
Noroxi analysis
What does it mean in your environment?
The assessment above is generated automatically from the record's data; it doesn't know your environment. Our team verifies on your systems whether this vulnerability is actually exploitable and which mitigation is enough.
We use this product, ask for helpAffected systems
Is your version affected?
Pick the product and type the version you run. It's compared with this record's version ranges in your browser; the version isn't sent anywhere.
| Vendor | Product | CPE |
|---|---|---|
| bytecodealliance | cranelift-codegen | cpe:2.3:a:bytecodealliance:cranelift-codegen |
| bytecodealliance | wasmtime | cpe:2.3:a:bytecodealliance:wasmtime |
Affected versions
NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.
- bytecodealliance cranelift-codegenbefore 0.85.0
- bytecodealliance wasmtimebefore 0.38.1
Versions reported by the vendor
Affected version ranges reported by the assigning authority (GitHub_M). Independent of NVD's CPE analysis and usually ahead of it.
bytecodealliance wasmtime
- wasmtime: < 0.38.1, cranelift-codegen: < 0.85.0affected
Package-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| crates.io | cranelift-codegen | before 0.85.1 | 0.85.1 |
| crates.io | wasmtime | from 0.0.0-0 · before 0.38.1 | 0.38.1 |
| crates.io | wasmtime | before 0.38.1 | 0.38.1 |
Same product
bytecodealliance: all recordsOther highest-scoring records for the same primary product.
- CVE-2023-26489Guest-controlled out-of-bounds read/write on x86_64 in wasmtime39Monitor
- CVE-2022-31146Use After Free in Wasmtime35Monitor
- CVE-2021-32629Memory access due to code generation flaw in Cranelift module35Monitor
Published before and after this one in the same product
- Later →CVE-2022-31169Jul 22, 2022 · Cranelift vulnerable to miscompilation of constant values in division on AArch6430Monitor
- Later →CVE-2023-27477Mar 8, 2023 · wasmtime is a fast and secure runtime for WebAssembly.17Monitor
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| crates.io:cranelift-codegen | 0.85.1 | Package registry (OSV) |
| crates.io:wasmtime | 0.38.1 | Package registry (OSV) |
Exploit status
No known public exploit
No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
No dated events beyond publication.
No history yet (it accumulates with the daily EPSS job).
Patch and commit links
Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.
Credits
All researchersFinders, reporters and analysts named in the CNA record. Click a name for that researcher’s other records.
No credits in the CNA record.
Variant candidates
Same product, same weakness class, within 18 months. If the patch missed the root cause, the sibling bug is here.
No nightly-computed relations.
Chain candidates
An authentication bypass and a privilege-requiring bug in the same product, published close together: combined they may become an unauthenticated path.
—
Bug bounty scope
No known public program.
Source: bounty-targets-data (public HackerOne, Bugcrowd, Intigriti, YesWeHack listings).
Technical details
Attack conditions
- Anyone who can reach it over the internet can trigger it.
- No account or password is required.
- No user action is required.
- Special conditions such as timing or configuration are required.
If successful
- Confidentiality
- low · data can be read
- Integrity
- low · data or configuration can be modified
- Availability
- low · the service can be disrupted
- Attack vector
- Network
- Attack complexity
- High
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality impact
- Low
- Integrity impact
- Low
- Availability impact
- Low
Weakness class (CWE)
CWE-682 · Incorrect CalculationCVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L
nvd-primary
Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
Attack patterns (CAPEC)
ATT&CK techniques
—
Change log
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
Show all references (5 more)Show less
Vendor advisories and official records. Exploit/PoC links are deliberately left out.