Miggo Logo

CVE-2023-27477:
wasmtime vulnerable to miscompilation of `i8x16.select` with the same inputs on x86_64

3.1

CVSS Score

Basic Information

EPSS Score
-
Published
3/9/2023
Updated
3/9/2023
KEV Status
No
Technology
TechnologyRust

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
wasmtimerust>= 1.0.0, < 4.0.14.0.1
wasmtimerust>= 5.0.0, < 5.0.15.0.1
wasmtimerust>= 6.0.0, < 6.0.16.0.1
cranelift-codegenrust>= 0.88.0, < 0.91.10.91.1
cranelift-codegenrust>= 0.92.0, < 0.92.10.92.1
cranelift-codegenrust>= 0.93.0, < 0.93.10.93.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability was explicitly fixed by modifying the shuffle_0_31_mask function in the commit diff. The critical line changed from b.wrapping_sub(15) to b.wrapping_sub(16) when handling indices >15. This function generates the shuffle mask for x86_64's pshufb instruction, and the off-by-one error directly caused the miscompilation of i8x16.select when selecting lanes from the second vector. No other functions in the provided diffs showed security-relevant changes.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Imp**t W*smtim*'s *o** **n*r*tion ***k*n*, *r*n*li*t, **s * *u* on x**_** pl*t*orms *or t** W***ss*m*ly `i*x**.s*l**t` instru*tion w*i** will pro*u** t** wron* r*sults w**n t** s*m* op*r*n* is provi*** to t** instru*tion *n* som* o* t** s*l**t**

Reasoning

T** vuln*r**ility w*s *xpli*itly *ix** *y mo*i*yin* t** `s*u**l*_*_**_m*sk` *un*tion in t** *ommit *i**. T** *riti**l lin* ***n*** *rom `*.wr*ppin*_su*(**)` to `*.wr*ppin*_su*(**)` w**n **n*lin* in*i**s >**. T*is *un*tion **n*r*t*s t** s*u**l* m*sk *