Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS1ndzVwLXE4bWotcDdnaM4AA14F

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

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

Permalink: https://github.com/advisories/GHSA-gw5p-q8mj-p7gh
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1ndzVwLXE4bWotcDdnaM4AA14F
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Low
Classification: General
Published: 8 months ago
Updated: 6 months ago


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

Identifiers: GHSA-gw5p-q8mj-p7gh, CVE-2023-41880
References: Repository: https://github.com/bytecodealliance/wasmtime
Blast Radius: 7.5

Affected Packages

cargo:wasmtime
Dependent packages: 126
Dependent repositories: 2,459
Downloads: 6,940,789 total
Affected Version Ranges: >= 12.0.0, < 12.0.2, >= 11.0.0, < 11.0.2, >= 10.0.0, < 10.0.2
Fixed in: 12.0.2, 11.0.2, 10.0.2
All affected versions: 10.0.0, 10.0.1, 11.0.0, 11.0.1, 12.0.0, 12.0.1
All unaffected versions: 0.0.0, 0.3.0, 0.7.0, 0.8.0, 0.9.0, 0.10.0, 0.11.0, 0.12.0, 0.13.0, 0.15.0, 0.16.0, 0.17.0, 0.18.0, 0.19.0, 0.20.0, 0.21.0, 0.22.0, 0.23.0, 0.24.0, 0.25.0, 0.26.0, 0.26.1, 0.27.0, 0.28.0, 0.29.0, 0.30.0, 0.31.0, 0.32.0, 0.32.1, 0.33.0, 0.33.1, 0.34.0, 0.34.1, 0.34.2, 0.35.0, 0.35.1, 0.35.2, 0.35.3, 0.36.0, 0.37.0, 0.38.0, 0.38.1, 0.38.2, 0.38.3, 0.39.0, 0.39.1, 0.40.0, 0.40.1, 1.0.0, 1.0.1, 1.0.2, 2.0.0, 2.0.1, 2.0.2, 3.0.0, 3.0.1, 4.0.0, 4.0.1, 5.0.0, 5.0.1, 6.0.0, 6.0.1, 6.0.2, 7.0.0, 7.0.1, 8.0.0, 8.0.1, 9.0.0, 9.0.1, 9.0.2, 9.0.3, 9.0.4, 10.0.2, 11.0.2, 12.0.2, 13.0.0, 13.0.1, 14.0.0, 14.0.1, 14.0.2, 14.0.3, 14.0.4, 15.0.0, 15.0.1, 16.0.0, 17.0.0, 17.0.1, 17.0.2, 17.0.3, 18.0.0, 18.0.1, 18.0.2, 18.0.3, 18.0.4, 19.0.0, 19.0.1, 19.0.2, 20.0.0