Skip to content

GHSA-gw5p-q8mj-p7gh CVE-2023-41880 RUSTSEC-2023-0091

Miscompilation of wasm `i64x2.shr_s` instruction with constant input on x86_64

Medium crates.io
Severity
2.2 / 10
Medium · CVSS 3.1
Exploit chance (EPSS)
0.67%
Chance of exploitation in the next 30 days. Higher than 52.10% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-193 Off-by-one Error
Fix
10.0.2
Upgrade wasmtime to this version or later

Description

Impact

Wasmtime versions from 10.0.0 to 12.0.1 contain a miscompilation of the WebAssembly i64x2.shr_s instruction on x86_64 platforms when the shift amount is a constant value that is larger than 32. Only x86_64 is affected so all other targets are not affected by this. The miscompilation results in the instruction producing an incorrect result, namely the low 32-bits of the second lane of the vector are derived from the low 32-bits of the second lane of the input vector instead of the high 32-bits. The primary impact of this issue is that any WebAssembly program using the i64x2.shr_s with a constant shift amount larger than 32 may produce an incorrect result.

This issue is not an escape from the WebAssembly sandbox. Execution of WebAssembly guest programs will still behave correctly with respect to memory sandboxing and isolation from the host. Wasmtime considers non-spec-compliant behavior as a security issue nonetheless.

This issue was discovered through fuzzing of Wasmtime's code generator Cranelift.

Patches

Wasmtime versions 10.0.2, 11.0.2, and 12.0.2 are all patched to no longer have this miscompilation.

Workarounds

This issue only affects x86_64 hosts and the only workaround is to either scan for this pattern in wasm modules which is nontrivial or to disable the SIMD proposal for WebAssembly. Users prior to 10.0.0 are unaffected by this vulnerability.

References

Affected versions

crates.io

PackageVulnerableFixed in
wasmtime
>= 10.0.0, < 10.0.2
10.0.2
wasmtime
>= 11.0.0, < 11.0.2
11.0.2
wasmtime
>= 12.0.0, < 12.0.2
12.0.2
wasmtime
>= 0.0.0-0, < 10.0.2
>= 11.0.0, < 11.0.2
>= 12.0.0, < 12.0.2
10.0.2
11.0.2
12.0.2

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

wasmtime crates.io → 10.0.2

cargo
cargo update -p wasmtime --precise 10.0.2

Severity breakdown

CVSS 3.1 2.2

CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:N

Attack vector
Network
Attack complexity
High
Privileges required
High
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
None

Weakness

CWE-193: Off-by-one Error

A product calculates or uses an incorrect maximum or minimum value that is 1 more, or 1 less, than the correct value.

How to prevent it
  • Implementation: When copying character arrays or using character manipulation methods, the correct size parameter must be used to account for the null terminator that needs to be added at the end of the array. Some examples of functions susceptible to this weakness in C include strcpy(), strncpy(), strcat(), strncat(), printf(), sprintf(), scanf() and sscanf().

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
RUSTSEC-2026-0424
Unchecked memory usage in transferring borrowed resources between components
Not rated yet Also affects wasmtime
RUSTSEC-2026-0423
Cross-engine type confusion with host-created struct-types-with-supertypes
Not rated yet Also affects wasmtime
RUSTSEC-2026-0422
Typed functions with `i31` or `nullref` arguments may panic due to insufficient type-check
Low Also affects wasmtime
RUSTSEC-2026-0379
Wasmtime: Cranelift backend on aarch64 can jump to incorrect target on large Wasm `br_table` instruction
Critical Also affects wasmtime
GHSA-9pvw-hwfg-92h5
Wasmtime: Panic lowering a host-created component model stream into a guest that expects a different payload type
Medium Also affects wasmtime
GHSA-897f-g5gm-fmxm
Wasmtime: Bit-packing in Cranelift compiler causes silent overflow and miscompilation
Critical Also affects wasmtime
RUSTSEC-2026-0364
Exception tags can cause host data structures to be unaligned
Not rated yet Also affects wasmtime
RUSTSEC-2026-0363
Component-model handle tables are capped only per instance and charged to no limit
Medium Also affects wasmtime
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor