Skip to content

← Actionable
Medium, CVSS 4.8

Miscompilation of i8x16.swizzle and select with v128 inputs

CVE-2022-31104GHSA-jqwc-c49r-4w2x

What to do

Vendor fix available. Upgrade each affected package to the fixed version on its release line (cranelift-codegen 0.85.1; wasmtime 0.38.1), redeploy, then verify what is actually installed.

This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.

Affected packages

Sources

Severity and exploitation
Exploitation
No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
CVSS
4.8 · CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:L
EPSS
  • CVE-2022-31104: 1.79% estimated exploitation activity in the next 30 days; percentile 78.33 (FIRST EPSS, 2026-11-03). This is a model estimate, not proof of exploitation or customer exposure.
Source description

As published by the source; long descriptions are shortened.

Impact Wasmtime's implementation of the SIMD proposal for WebAssembly on x8664 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…

Dates and revisions
Published by the source
Last modified by the source
Source last checked
  1. Revision 1 · created ·

    Published from ghsa record GHSA-jqwc-c49r-4w2x

Agent brief

Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.

# Patch Next advisory brief: CVE-2022-31104

Advisory: Miscompilation of `i8x16.swizzle` and `select` with v128 inputs
IDs: CVE-2022-31104, GHSA-jqwc-c49r-4w2x
Record: https://patchnext.com/advisories/cve-2022-31104 (revision 1, source checked 26 Oct 2026, 15:38 UTC)
Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected.
Severity: Medium (CVSS 4.8)
Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV.
Vendor response: Vendor fix available; fixed versions by package: cranelift-codegen 0.85.1; wasmtime 0.38.1. A vendor fix does not mean a deployment is fixed.

## Affected components
- crates.io cranelift-codegen: affected < 0.85.1; fixed in 0.85.1
- crates.io wasmtime: affected < 0.38.1; fixed in 0.38.1

## Suggested inspection (read-only)
- crates.io cranelift-codegen: check the installed version with your package manager.
- crates.io wasmtime: check the installed version with your package manager.

## Supported action
Upgrade each affected component to a fixed version on its release line. For a transitive dependency, upgrade the parent package or add an override or constraint, then regenerate the lockfile. Redeploy every environment that ran an affected version.

## Required regression checks
- Run the test suite and a production build.
- Exercise the features that depend on cranelift-codegen, wasmtime.
- Repeat the inspection and confirm that only fixed versions remain installed.

## Rollback considerations
- Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward.

## Unresolved questions
- Which deployments run an affected version?
- Exploitation status can change. Check again before lowering the priority.
- Mark the work resolved only after the fixed version is verified in production.

## Sources
- Verified: https://github.com/advisories/GHSA-jqwc-c49r-4w2x (GitHub-reviewed advisory GHSA-jqwc-c49r-4w2x lists affected ranges: crates.io wasmtime >=0 =0 <0.85.1)

Commands are suggestions: review each one before running it.

Loading voting…