CVE-2023-41880
Miscompilation of wasm `i64x2.shr_s` instruction with constant input on x86_64
Severity Score
Exploit Likelihood
Affected Versions
Public Exploits
0Exploited in Wild
-Decision
Descriptions
Wasmtime is a standalone runtime for WebAssembly. Wasmtime versions from 10.0.0 to versions 10.02, 11.0.2, and 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.
Wasmtime versions 10.0.2, 11.0.2, and 12.0.2 are all patched to no longer have this miscompilation. 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.
Wasmtime es un standalone en tiempo de ejecución para WebAssembly. Las versiones de Wasmtime desde 10.0.0 hasta las versiones 10.02, 11.0.2 y 12.0.1 contienen una mala compilación de la instrucción WebAssembly `i64x2.shr_s` en plataformas x86_64 cuando la cantidad de desplazamiento es un valor constante mayor que 32. Solo x86_64 es afectado por lo que todos los demás objetivos no se ven afectados por esto. La mala compilación da como resultado que la instrucción produzca un resultado incorrecto, es decir, los 32 bits bajos del segundo carril del vector se derivan de los 32 bits bajos del segundo carril del vector de entrada en lugar de los 32 bits altos. El impacto principal de este problema es que cualquier programa WebAssembly que utilice `i64x2.shr_s` con una cantidad de desplazamiento constante mayor que 32 puede producir un resultado incorrecto. Este problema no es un escape del entorno limitado de WebAssembly. La ejecución de los programas invitados de WebAssembly seguirá comportándose correctamente con respecto al espacio aislado de la memoria y el aislamiento del host. No obstante, Wasmtime considera el comportamiento que no cumple con las especificaciones como un problema de seguridad. Este problema se descubrió mediante la confusión del generador de código Cranelift de Wasmtime. Las versiones 10.0.2, 11.0.2 y 12.0.2 de Wasmtime están parcheadas para que ya no tengan esta mala compilación. Este problema solo afecta a los hosts x86_64 y el único workaround es buscar este patrón en los módulos wasm, lo cual no es trivial, o deshabilitar la propuesta SIMD para WebAssembly. Los usuarios anteriores a 10.0.0 no se ven afectados por esta vulnerabilidad.
CVSS Scores
SSVC
- Decision:Track
Timeline
- 2023-09-04 CVE Reserved
- 2023-09-15 CVE Published
- 2024-09-24 CVE Updated
- 2024-10-17 EPSS Updated
- ---------- Exploited in Wild
- ---------- KEV Due Date
- ---------- First Exploit
CWE
- CWE-193: Off-by-one Error
CAPEC
References (5)
URL | Tag | Source |
---|---|---|
https://docs.rs/wasmtime/latest/wasmtime/struct.Config.html#method.wasm_simd | Product |
URL | Date | SRC |
---|
Affected Vendors, Products, and Versions
Vendor | Product | Version | Other | Status | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Vendor | Product | Version | Other | Status | <-- --> | Vendor | Product | Version | Other | Status |
Bytecodealliance Search vendor "Bytecodealliance" | Wasmtime Search vendor "Bytecodealliance" for product "Wasmtime" | >= 10.0.0 < 10.0.2 Search vendor "Bytecodealliance" for product "Wasmtime" and version " >= 10.0.0 < 10.0.2" | rust, x64 |
Affected
| ||||||
Bytecodealliance Search vendor "Bytecodealliance" | Wasmtime Search vendor "Bytecodealliance" for product "Wasmtime" | >= 11.0.0 < 11.0.2 Search vendor "Bytecodealliance" for product "Wasmtime" and version " >= 11.0.0 < 11.0.2" | rust, x64 |
Affected
| ||||||
Bytecodealliance Search vendor "Bytecodealliance" | Wasmtime Search vendor "Bytecodealliance" for product "Wasmtime" | >= 12.0.0 < 12.0.2 Search vendor "Bytecodealliance" for product "Wasmtime" and version " >= 12.0.0 < 12.0.2" | rust, x64 |
Affected
|