WebAssembly binaries are often compiled from memory-unsafe languages, such as C and C++. Because of WebAssembly's linear memory and missing protection features, e.g., stack canaries, source-level memory vulnerabilities are exploitable in compiled WebAssembly binaries, sometimes even more easily than in native code. This paper addresses the problem of detecting such vulnerabilities through the first binary-only fuzzer for WebAssembly. Our approach, called Fuzzm, combines canary instrumentation to detect overflows and underflows on the stack and the heap, an efficient coverage instrumentation, a WebAssembly VM, and the input generation algorithm of the popular AFL fuzzer. Besides as an oracle for fuzzing, our canaries also serve as a stand-alone binary hardening technique to prevent the exploitation of vulnerable binaries in production. We evaluate Fuzzm with 28 real-world WebAssembly binaries, some compiled from source and some found in the wild without source code. The fuzzer explores thousands of execution paths, triggers dozens of crashes, and performs hundreds of program executions per second. When used for binary hardening, the approach prevents previously published exploits against vulnerable WebAssembly binaries while imposing low runtime overhead.
翻译:由于WebAssembly的线性内存和缺失的保护功能,例如堆放金丝雀,源级的记忆弱点可在编篡的WebAssembly的二进制中加以利用,有时甚至比本地代码更容易。本文论述通过WebAssembly的第一个二进制模糊器来探测这种弱点的问题。我们的方法叫做Fuzzm,它结合了用于探测堆叠和堆叠中溢出和下流的罐子仪器、高效的覆盖仪表、WebAsy VM,以及流行的AFL fuzzer的输入生成算法。除了作为烟雾的奥秘外,我们的金丝雀还作为一种独立的二进制硬化技术,以防止在生产中利用脆弱的二进制双进制。我们用28个真实世界的WebAssembly 书目来评价Fuzzm,有些是从源中编成的,有些在野生无源代码中发现的。模糊者探索数千条执行路径,触发数十次的碰撞,每秒执行数百次的程式。当用来进行脆弱的硬盘操作时,以前用来进行低式的硬化。