Skip to main content
QUICK REVIEW

[论文解读] Fuzzm: Finding Memory Bugs through Binary-Only Instrumentation and Fuzzing of WebAssembly

Daniel Lehmann, Martin Toldam Torp|arXiv (Cornell University)|Oct 28, 2021
Security and Verification in Computing被引用 6
一句话总结

Fuzzm 是首个针对 WebAssembly 的仅二进制灰盒模糊测试工具,结合了栈和堆保险丝检测机制,配备高效的覆盖率反馈与 AFL 风格的输入生成。它无需源代码即可在生产环境的 WebAssembly 二进制文件中检测内存漏洞,成功触发了数十个真实二进制文件的崩溃,并实现了低开销的二进制加固,以防止利用。

ABSTRACT

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.

研究动机与目标

  • 为 C 和 C++ 等不安全语言编译生成的 WebAssembly 二进制文件中日益增长的内存漏洞安全风险提供解决方案。
  • 克服 WebAssembly 缺乏内置内存安全机制(如栈保险丝和页保护)的问题,这些机制使得利用比原生代码更可行。
  • 通过设计与现有模糊测试工作流兼容的仅二进制检测与反馈管道,实现在无源代码的情况下对 WebAssembly 二进制文件进行有效模糊测试。
  • 提供一种实用、高效且可部署的解决方案,用于检测内存漏洞并加固现有生产环境中的 WebAssembly 二进制文件。

提出的方法

  • 通过在 WebAssembly 二进制文件中插入栈和堆保险丝,在运行时检测溢出与下溢,作为模糊测试的判定依据,同时作为二进制加固机制。
  • 实现一种轻量级的仅二进制覆盖率检测机制,追踪执行路径,而无需依赖编译器插入的代码或架构特定的动态二进制分析技术。
  • 将 AFL 的输入生成引擎与 WebAssembly 虚拟机集成,实现对 WebAssembly 二进制文件的高效、高吞吐量模糊测试。
  • 在 WebAssembly 虚拟机中为模糊测试器与目标程序使用单一地址空间,降低开销并实现高效的反馈收集。
  • 在堆缓冲区释放时应用保险丝检查,以在保持漏洞检测能力的同时最小化性能开销。
  • 在 28 个真实世界的 WebAssembly 二进制文件上验证该方法,包括从源码编译的和在野外发现的第三方二进制文件。

实验结果

研究问题

  • RQ1在无源代码访问的情况下,仅二进制模糊测试工具能否有效检测 WebAssembly 二进制文件中的内存漏洞?
  • RQ2在缺乏标准编译器缓解措施的情况下,基于保险丝的检测机制在检测 WebAssembly 二进制文件中栈和堆溢出方面的有效性如何,尤其是针对典型漏洞?
  • RQ3能否高效地将覆盖率检测机制应用于 WebAssembly 二进制文件,以指导模糊测试,而无需依赖编译器插入的检测代码?
  • RQ4所提出的检测机制的性能开销如何?是否能够支持高吞吐量模糊测试(例如每秒数百次执行)?
  • RQ5用于模糊测试的同一检测机制是否也可作为实用的二进制加固技术,防止在生产环境中利用已知漏洞?

主要发现

  • Fuzzm 在 28 个真实世界的 WebAssembly 二进制文件中成功触发了数十次崩溃,证明其在发现内存漏洞方面的有效性。
  • 该模糊测试器实现了每秒数百次程序执行的性能,尽管相比原生代码存在固有的性能开销,但仍具备实用性。
  • 保险丝检测机制成功识别了栈溢出与堆溢出,包括在 WebAssembly 的线性内存模型下,栈溢出影响堆数据而通常难以察觉的情况。
  • 覆盖率检测机制为 AFL 风格的输入生成提供了有效反馈,使模糊测试能够探索目标二进制文件中的数千条执行路径。
  • 相同的保险丝检测机制在作为独立加固技术使用时,成功阻止了针对已知漏洞 WebAssembly 二进制文件的已有公开利用。
  • 该方法引入的运行时开销极低,适用于生产环境部署,可在不重新编译的情况下保护现有二进制文件。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。