WWW2026
Broken Promise: Differential Analysis of Functional Discrepancies Between WebAssembly and Native Binaries
Xiao Wu, Alan Romano, Liyan Huang, Qiwen Yan, Cai Fu, Weihang Wang
Abstract
WebAssembly (Wasm) is a web standard that defines a binary instruction format serving as a portable compilation target for high-level programming languages. As a cornerstone design feature, code porting empowers developers to migrate code across platforms without extensive redevelopment. However, we observe that certain native code exhibits functional discrepancies compared to its Wasm counterpart. These discrepancies impede migration by causing functional alterations, generating misleading messages, and forcing platform-specific workarounds. In this paper, we present an in-depth analysis of these Native-to-Wasm discrepancies, demonstrating that they often stem from complex underlying causes, leading to unexpected outcomes in real-world applications. We characterize the root causes and practical implications of these discrepancies, providing critical insights into WebAssembly code porting challenges. To facilitate this large-scale analysis, we develop WasmDiff, an automated differential fuzzing framework that detects Native-to-Wasm discrepancies by comparing the execution of identical code across platforms to identify input-triggered behavioral differences. We identify 14,053 discrepancies across 64,001 test samples from the basic benchmark and 3,102 discrepancies within eight real-world projects. Our findings reveal that discrepancies are prevalent, input-dependent and rooted in diverse execution stacks, underscoring the need for greater attention to code porting issues in the WebAssembly ecosystem.