← Lab /Software

Ruzzy now supports LibAFL, enabling functional Ruby fuzzing with a working pipeline

Integrating LibAFL into Ruzzy provides a functional Ruby fuzzing engine that can detect bugs.

Software Trail of Bits 29 Apr 2026 Tooling Prototype evidence

Published as “Extending Ruzzy with LibAFL”

Why it matters

Ruby developers can now leverage LibAFL’s modern fuzzing techniques without rewriting their harnesses.

Summary

The author added LibAFL as a drop-in replacement for libFuzzer in the Ruby fuzzer Ruzzy, fixing ELF .preinit_array linking errors by using LLVM's ld and adjusting the Ruby C extension load order. After these patches, LibAFL runs, initializes SanitizerCoverage, and discovers an intentional heap-use-after-free bug in a dummy C extension. Evidence is limited to a single test target but demonstrates end-to-end functionality.

What they found 2

  1. LibAFL integration works after applying linker and initialization patches.

    “With the ld and initialization patches, LibAFL finally works (!):”

  2. The integrated pipeline detects the intentional bug in the dummy C extension.

    “This AddressSanitizer output shows that LibAFL starts cleanly and quickly finds the intentional bug in dummy.c .”

Caveats 4

  • This required having a trick up our sleeve: GNU ld enforces the .preinit_array-in-a-DSO constraint, but LLVM ld does not.
  • This leaves us with two options: the proper solution, which is to propose a change upstream that allows these features to be toggled at build time, and the hacky, make-it-work solution.
  • The key error here is “.preinit_array section is not allowed in DSO.”
  • The key error here is “No maps available; cannot fuzz!” This LibAFL error occurs when the SanitizerCoverage state is not initialized properly.

What’s new here 4

  • Added LibAFL compatibility layer to Ruzzy via libafl_libfuzzer build.
  • Implemented a linker workaround using LLVM ld to bypass .preinit_array restrictions in DSOs.
  • Patched Ruby C extension loading order to ensure coverage counters are initialized before fuzzing starts.
  • Released Ruzzy 0.8.0 with LibAFL support.