Skip to main content
QUICK REVIEW

[Paper Review] APFuzz: Towards Automatic Greybox Protocol Fuzzing

Yu Wang, Yang Xiang|arXiv (Cornell University)|Feb 25, 2026
Software Testing and Debugging TechniquesComputer Science0 citations
TL;DR

APFuzz introduces automatic state representation learning and LLM-based input structure learning to enable smarter greybox protocol fuzzing, achieving improved coverage and crashes on a standard fuzzing benchmark compared to AFLNET and peers.

ABSTRACT

Greybox protocol fuzzing is a random testing approach for stateful protocol implementations, where the input is protocol messages generated from mutations of seeds, and the search in the input space is driven by the feedback on coverage of both code and state. State model and message model are the core components of communication protocols, which also have significant impacts on protocol fuzzing. In this work, we propose APFuzz (Automatic greybox Protocol Fuzzer) with novel designs to increase the smartness of greybox protocol fuzzers from the perspectives of both the state model and the message model. On the one hand, APFuzz employs a two-stage process of static and dynamic analysis to automatically identify state variables, which are then used to infer an accurate state model during fuzzing. On the other hand, APFuzz introduces field-level mutation operations for binary protocols, leveraging message structure awareness enabled by Large Language Models. We conduct extensive experiments on a public protocol fuzzing benchmark, comparing APFuzz with the baseline fuzzer AFLNET as well as several state-of-the-art greybox protocol fuzzers.

Motivation & Objective

  • Motivate automatic, accurate state representation learning to replace manual state modeling in greybox protocol fuzzing.
  • Develop a two-stage static+dynamic analysis pipeline to identify state variables from source code.
  • Leverage Large Language Models to learn field-level message structure for binary protocols.
  • Enable field-based mutations to generate valid, coverage-advancing inputs.

Proposed method

  • Two-stage state variable identification using static analysis to collect candidate state variables and lightweight dynamic analysis to filter noise.
  • Dynamic instrumentation (LLVM-based) to track state variable usage during execution and to build a state sequence.
  • Instrumented fuzzing loop that updates a state model from feedback and preserves inputs that reveal new states or increase coverage.
  • LLM-based seed interpretation to extract field-level structure of binary protocol messages (field name, bit start, bit length).
  • Field-based mutation operators guided by learned bit ranges, integrated with existing byte- and message-level mutations (Deterministic, Classical, Field-Based).
  • Algorithmic framework (Algorithm 1) coordinating seed selection, mutations, state updates, and feedback for progressive state-model inference.
Figure 1: System framework
Figure 1: System framework

Experimental results

Research questions

  • RQ1RQ1: Can the binary message format of seeds be accurately interpreted by an LLM-based approach?
  • RQ2RQ2: Can state variables be identified automatically without manual intervention?
  • RQ3RQ3: How does APFuzz compare to AFLNET and state-of-the-art greybox protocol fuzzers in effectiveness and efficiency?

Key findings

  • APFuzz learns protocol state variables automatically through static and lightweight dynamic analysis, enabling efficient state tracking.
  • LLM-based seed interpretation achieves field-level understanding of binary messages, enabling field-based mutations across binary protocols.
  • APFuzz demonstrates code and state coverage improvements and crash discovery on ProFuzzBench benchmarks compared with AFLNET, StateAFL, NSFuzz, ChatAFL, HNPFuzzer, SGFuzz, and other baselines.
  • The field-based mutation approach extends structure-aware fuzzing to binary protocols, generating more valid test cases and exploring deeper state spaces.
Figure 3: The inferred state model of LightFTP by APFuzz
Figure 3: The inferred state model of LightFTP by APFuzz

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.