Rust and Go directed fuzzing with LibAFL-DiFuzz
Listen
Radio episode about this paper
Transcript
Introduction to the show: ident: Security Radio. Generated commentary on the latest security and cryptography papers.
Nadia: Today's paper: "Rust and Go directed fuzzing with LibAFL-DiFuzz".
Elias: Directed fuzzing for Rust and Go applications is introduced through a novel approach utilizing LibAFL-DiFuzz, which addresses the need for precise testing solutions beyond traditional coverage-guided methods.
Nadia: First, who's behind it and why it matters.
Title and authors: Nadia: We’ve covered the setup, and now we need to look at what they actually propose in "Rust and Go directed fuzzing with LibAFL-DiFuzz." They're essentially introducing a unified system for directing fuzzing efforts into these two major compiled languages.
Elias: The core idea revolves around enabling this directed fuzzing by adding specific preprocessing steps, like using rustc compiler customization for Rust, and creating a combined approach to graph construction with correct debug information based on AST and SSA IR for Go code.
Priya: I’m looking at the methodology described in the paper, and it seems they are building tools from scratch using different underlying language representations—LLVM IR for Rust and SSA IR for Go—to get that accurate feedback.
Nadia: Right, Priya, so they’re not just slapping an existing fuzzer onto these languages; they’re modifying the compilation process itself to feed the fuzzer better information.
Elias: They also mention their feedback instrumentors that work directly on the source code of Go programs, which is a significant detail when you're dealing with an intermediate representation like SSA IR.
Priya: That level of instrumentation suggests they are going deep into how those languages handle control flow to ensure the fuzzer gets meaningful guidance for those specific target points.
The paper's summary: Nadia: So, summarizing what the paper presents, they propose a four-step process for LibAFL-DiFuzz: static analysis to get enhanced target sequences called ETS, followed by implementing ETS feedback through target program instrumentation and SanCov instrumentation for coverage.
Elias: That sequence sounds like it’s designed to first pinpoint where we want to test, then instrument the code around those specific areas, and finally add coverage tracking.
Priya: The mention of linking with the libforkserver library which contains all the required utilities adds another layer to how this framework is set up for actual execution during fuzzing.
Nadia: And for Rust specifically, they adapt DiFuzz-Rust to use LLVM IR and debug information from LLVM passes to build Call Graphs and Control Flow Graphs.
Elias: Meanwhile, the Go approach is quite different; they implement a DiFuzz-Go library to construct graphs using native Go libraries like go/ast, go/ssa, and go/cfg for both Call Graph construction and CFGs.
Priya: It sounds like the paper is showing that you can successfully bridge these two very different compilation and representation models—LLVM for Rust and SSA IR for Go—into one directed fuzzing pipeline.
The paper's improvements: Nadia: The authors highlight several specific improvements they made, particularly in how they handle the language-specific challenges, like modifying rustc to create libafl rustc.
Elias: And for Go, their combined approach to graph construction is a notable improvement because it uses SSA IR first to build the Call Graph and then builds CFGs for each function to collect unified debug information.
Priya: I’m interested in the source code level instrumentation they use for Go, like inserting high-level commands such as InstrumentETS(ID) and SancovGuard(ID) using go/ast.
Nadia: That direct source code manipulation for Go seems very powerful because it allows them to inject feedback precisely where they need it based on the ETS IDs they calculated earlier.
Elias: The authors also emphasize that their tools are evaluated against existing fuzzers, and the results show Rust-LibAFL-DiFuzz outperforms other tools by the best TTE result.
Priya: While those TTE results are impressive for speed, I want to ask what those metrics actually tell us about the quality of the coverage feedback they get compared to simply running a long, traditional coverage run.
Conclusion: Nadia: So, wrapping up the "Rust and Go directed fuzzing with LibAFL-DiFuzz" paper, we see they’ve successfully implemented tools for both languages using tailored techniques for preprocessing and instrumentation.
Elias: The authors conclude that their implementation of the Rust and Go directed fuzzing tools based on the LibAFL-DiFuzz backend provides a strong performance baseline compared to established competitors like afl.rs, cargo-fuzz, and gofuzz.
Priya: I think what stands out is that they managed to tackle the differing IRs—LLVM versus SSA IR—and produce tools that are both functional and relatively fast in terms of exposure time.
Nadia: It’s a solid piece of work because it shows a viable path for applying this directed testing strategy to these popular languages outside of just C/C++.
Elias: And the implication is that we can now expect more precise and efficient testing solutions when we start looking at critical components written in Rust or Go.
Priya: For the privacy researchers among us, this means if you're fuzzing infrastructure that handles sensitive data, having a tool that targets specific logic paths directly could uncover subtle leaks much faster than general coverage tools allow.
Nadia: We’ve seen a lot of excitement about this paper because it shows how to make targeted testing practical and fast for these systems.
Ivannikov Institute for System Programming of the Russian Academy of Sciences · Lomonosov Moscow State University
cs.CR
Submitted: 2026-01-30
Updated: 2026-10-05
Code: https://github.com/rust-fuzz/afl.rs
License: http://creativecommons.org/licenses/by-nc-nd/4.0/
Importance score: 86/100
The gist: Directed fuzzing for Rust and Go applications is introduced through a novel approach utilizing LibAFL-DiFuzz, which addresses the need for precise testing solutions beyond traditional coverage-guided
Key concepts
- LibAFL-DiFuzz
- A new directed fuzzing approach that prepares programs for testing. It involves static analysis to find target sequences, custom compiler modifications for Rust, and graph construction using SSA IR for Go code. This method provides precise guidance to the fuzzer.
- Enhanced Target Sequences (ETS)
- These are lists of basic blocks leading to specific target points in a program. They are obtained through static analysis and include computed context weights. ETS feedback is then used to guide the fuzzing process, telling the fuzzer which code paths are most important.
- SSA IR for Go
- Go uses SSA (Static Single Assignment) Intermediate Representation instead of LLVM IR. The paper describes a method to build Call Graphs (CGs) and Control Flow Graphs (CFGs) from this SSA IR. This allows the tool to gather unified debug information necessary for effective graph construction in Go.
Terminology
Summary
Directed fuzzing for Rust and Go applications is introduced through a novel approach utilizing LibAFL-DiFuzz, which addresses the need for precise testing solutions beyond traditional coverage-guided methods. This work expands directed fuzzing applicability to Rust and Go by proposing advanced preprocessing techniques, compiler customizations, and graph construction/instrumentation methods tailored specifically for these languages. The implemented tools demonstrate competitive advantages over existing fuzzers like afl.rs, cargo-fuzz, and go-fuzz when measured by Time to Exposure (TTE) experiments.
Contributions
The paper makes several key contributions to the field of directed fuzzing for Rust and Go:
-
A novel approach is proposed to enable directed fuzzing of Rust and Go applications, which includes
generic functions handling at preprocessing stage
for Rust,rustc compiler customization for Rust directed fuzzing,
and acombined approach to graph construction with correct debug information based on AST and SSA IR for Go code.
-
The first Rust and Go directed fuzzing tools are implemented based on the LibAFL-DiFuzz backend.
-
The tools are evaluated against popular existing fuzzers using the Time to Exposure (TTE) metric, showing that
Rust-LibAFL-DiFuzz outperforms other tools by the best TTE result.
-
For Go,
Go-LibAFL outperforms its opponent by the best and, in the majority of cases, by average result,
with two cases showingorders of magnitude difference.
Directed Fuzzing Approach (LibAFL-DiFuzz)
The directed fuzzing approach implemented in LibAFL-DiFuzz involves a four-step process to prepare the target for directed fuzzing:
-
Static analysis to obtain
enhanced target sequences (ETS) – the lists of basic blocks leading to target points with computed context weights.
-
Target program instrumentation based on the ETS obtained in the previous step, which is referred to as
implementation of ETS feedback.
-
SanCov instrumentation for coverage feedback.
-
Linking with the libforkserver library, which contains
all required utilities for fuzzing.
The generalized pipeline involves inserting code that writes target basic blocks unique IDs to an ETS shared memory and calling a function like libafl start forkserver at the beginning of the program.
SanCov instrumentation inserts calls like sanitizer cov trace pc guard
into all possible basic blocks to provide coverage guidance.
Rust Directed Fuzzing
Building fuzzing targets for Rust is conceptually similar to C/C++ but requires specific modifications due to Rust's compilation based on the LLVM toolchain. The process involves:
-
Adapting the DiFuzz static preprocessing tool, referred to as
DiFuzz-Rust,
which uses LLVM IR and debug information fromLLVM-passes
to build Call Graphs (CGs) and Control Flow Graphs (CFGs). -
Modifying the rustc compiler itself to instrument the code, resulting in a customized compiler called
libafl rustc.
-
Applying specific arguments to the custom compiler, such as “-C opt-level=0” to disable optimization, and passes like “-C passes=difuzz-etspass” for ETS feedback instrumentation and “-C passes=sancovmodule-C llvm-args=-sanitizer-coverage-level=3-C llvm-args=-sanitizer-coverage-trace-pcguard” for SanCov instrumentation.
Go Directed Fuzzing
The approach to supporting Go projects differs significantly because Go compilation relies on its own intermediate representation (IR) called SSA IR, rather than the LLVM toolchain. The implementation involves:
-
Implementing a
DiFuzz-Go library
to construct graphs and obtain debug information for functions and basic blocks using native Go libraries such as “go/ast,” “go/ssa,” and “go/cfg.” -
A combined approach for graph construction: first, a Call Graph (CG) is constructed using SSA IR, followed by CFGs for each function in the graph to collect
unified debug information.
-
Conversion of the resulting graphs to a DOT format compatible with the DiFuzz tool using a special formatter that traverses the graph in depth.
-
Instrumentation is performed at the source code level rather than at an intermediate representation level, using libraries like “go/ast” to insert high-level commands and function calls, such as “InstrumentETS(ID)” for ETS feedback and “SancovGuard(ID)” for coverage feedback.
Evaluation Results
The tools were evaluated using the Time to Exposure (TTE) metric across various projects in Rust (e.g., goblin, gdb-command) and Go (e.g., ollama, image-go).
Improvements for AI systems
Based on the provided scientific paper, here are specific improvements that could be made to AI systems, along with what those improved systems could achieve:
The core contribution of this research is a novel directed fuzzing framework (LibAFL-DiFuzz) specifically tailored for Rust and Go applications. Applying these techniques to AI/ML systems would yield significant improvements in their robustness, security, and verification.
Here are the specific improvements:
-
Replacement of traditional coverage-guided fuzzing with the proposed LibAFL-DiFuzz directed greybox fuzzing approach for models implemented in Rust or Go (e.g., inference engines, custom ML kernels).
-
Integration of advanced preprocessing techniques and compiler customizations (like those described in Section 4 and 5) to build highly accurate call graphs and control flow graphs from the target language's specific IR (LLVM for Rust, SSA IR for Go).
-
Implementation of source-code level instrumentation (ETS and SanCov feedback) that directly injects unique identifiers into the fuzzer's shared memory based on identified target basic blocks, rather than relying solely on intermediate representation feedback.
The improved AI systems could achieve the following specific capabilities:
-
Enhanced Robustness Against Adversarial Attacks:
-
Improved Vulnerability Detection in ML Infrastructure:
-
More Efficient Model Verification and Testing:
-
Faster Discovery of Edge Cases in Complex Systems:
The specific benefits for these improved AI systems are detailed below:
-
When applied to AI inference engines or custom model kernels written in Rust or Go, the system can be rigorously tested against targeted failure modes (like specific data handling logic, memory corruption paths, or control flow vulnerabilities) that are often missed by general fuzzers. This prevents catastrophic failures during deployment in production environments where robustness is paramount.
-
For AI systems where the core logic is implemented in Go (e.g., serving infrastructure), this method allows for precise targeting of critical functions (like input parsing, decision-making loops, or resource allocation) to discover bugs with significantly higher speed and accuracy than existing tools like go-fuzz. This means the system can be verified much faster before being deployed as a production service.
-
For model development pipelines in Rust, the ability to precisely target specific code paths (via ETS feedback) allows researchers to reproduce crashes or errors related to specific mathematical operations or data transformations within the model execution logic, leading to quicker debugging cycles and more reliable model training/refinement.
-
The overall efficiency gains demonstrated by LibAFL-DiFuzz (outperforming competitors in TTE experiments) mean that AI teams can spend less time running long, inefficient fuzzing campaigns and more time focusing on developing new features or improving the model itself, leading to a faster iteration cycle for secure AI development.
Abstract
In modern SSDLC, program analysis and automated testing are essential for minimizing vulnerabilities before software release, with fuzzing being a fast and widely used dynamic testing method. However, traditional coverage-guided fuzzing may be less effective in specific tasks like verifying static analysis reports or reproducing crashes, while directed fuzzing, focusing on targeted program locations using proximity metrics, proves to be more effective. Some of the earliest directed fuzzers are, for example, AFLGo and BEACON, which use different proximity metric approaches. Although most automated testing tools focus on C/C++ code, the growing popularity of Rust and Go causes the need for precise and efficient testing solutions for these languages. This work expands the applicability of directed fuzzing beyond traditional analysis of C/C++ software. We present a novel approach to directed greybox fuzzing tailored specifically for Rust and Go applications. We introduce advanced preprocessing techniques, rustc compiler customizations, and elaborate graph construction and instrumentation methods to enable effective targeting of specific program locations. Our implemented fuzzing tools, based on LibAFL-DiFuzz backend, demonstrate competitive advantages compared to popular existing fuzzers like afl. rs, cargo-fuzz, and go-fuzz. According to TTE (Time to Exposure) experiments, Rust-LibAFL-DiFuzz outperforms other tools by the best TTE result. Some stability issues can be explained by different mutation approaches. Go-LibAFL-DiFuzz outperforms its opponent by the best and, in the majority of cases, by average result, having two cases with orders of magnitude difference. These results prove better efficiency and accuracy of our approach.
Sources
Related papers
- SoK: AI-Augmented Binary Reversing
- Relaxed Sender Anonymity for CBDC Interbank Settlement: A Zero-Knowledge Approach on Permissioned EVM
- Calibration-Family Overfit: Why Trusted Sabotage Monitors Don't Transfer Across Lineages
- Efficient Fuzzy PSI under One-Sided Assumptions
- Sealing the Audit-Runtime Gap for LLM Skills
- Token Composition: A Graph Based on EVM Logs