Skip to main content
QUICK REVIEW

[Paper 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 ComputingComputer Science6 citations
TL;DR

Fuzzm is the first binary-only greybox fuzzer for WebAssembly that combines stack and heap canary instrumentation with efficient coverage feedback and AFL-style input generation. It detects memory bugs in production WebAssembly binaries without source code, triggers dozens of crashes in real-world binaries, and enables low-overhead binary hardening to prevent exploits.

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.

Motivation & Objective

  • To address the growing security risk posed by memory vulnerabilities in WebAssembly binaries compiled from unsafe languages like C and C++.
  • To overcome the lack of built-in memory safety mechanisms in WebAssembly, such as stack canaries and page protections, which make exploits more feasible than in native code.
  • To enable effective fuzzing of WebAssembly binaries without source code, by designing a binary-only instrumentation and feedback pipeline compatible with existing fuzzing workflows.
  • To provide a practical, efficient, and deployable solution for detecting memory bugs and hardening existing WebAssembly binaries in production.

Proposed method

  • Instrumenting WebAssembly binaries with stack and heap canaries to detect overflows and underflows at runtime, serving as both fuzzing oracles and a binary hardening mechanism.
  • Implementing a lightweight, binary-only coverage instrumentation that tracks execution paths without relying on compiler-inserted code or architecture-specific dynamic binary instrumentation.
  • Integrating the input generation engine of AFL with a WebAssembly VM to enable efficient, high-throughput fuzzing of WebAssembly binaries.
  • Using a single address space for the fuzzer and target program within the WebAssembly VM, reducing overhead and enabling efficient feedback collection.
  • Applying the canary checks at deallocation time for heap buffers to minimize performance cost while maintaining exploit detection capability.
  • Validating the approach on 28 real-world WebAssembly binaries, including both compiled-from-source and third-party binaries found in the wild.

Experimental results

Research questions

  • RQ1Can a binary-only fuzzer effectively detect memory vulnerabilities in WebAssembly binaries without access to source code?
  • RQ2How effective is canary-based instrumentation in detecting stack and heap overflows in WebAssembly binaries, especially when standard compiler mitigations are absent?
  • RQ3Can coverage instrumentation be efficiently applied to WebAssembly binaries to guide fuzzing, without relying on compiler-inserted instrumentation?
  • RQ4What is the performance overhead of the proposed instrumentation, and can it support high-throughput fuzzing (e.g., hundreds of executions per second)?
  • RQ5Can the same instrumentation used for fuzzing also serve as a practical binary hardening technique to prevent exploitation of known vulnerabilities in production?

Key findings

  • Fuzzm successfully triggered dozens of crashes in 28 real-world WebAssembly binaries, demonstrating its effectiveness in uncovering memory vulnerabilities.
  • The fuzzer achieved performance of hundreds of program executions per second, making it practical despite WebAssembly’s inherent performance overhead compared to native code.
  • The canary instrumentation detected both stack and heap overflows, including cases where overflows from stack to heap data would otherwise go unnoticed due to WebAssembly’s linear memory model.
  • The coverage instrumentation provided effective feedback for AFL-style input generation, enabling exploration of thousands of execution paths in the target binaries.
  • The same canary instrumentation successfully prevented previously published exploits against vulnerable WebAssembly binaries when used as a standalone hardening technique.
  • The approach imposes low runtime overhead, making it suitable for deployment in production environments to protect existing binaries without recompilation.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.