AFLNet Five Years Later: On Coverage-Guided Protocol Fuzzing

Ruijie Meng, Van-Thuan Pham, Marcel Böhme, Abhik Roychoudhury

TL;DR

AFLNet is the first coverage-guided greybox fuzzer designed specifically for stateful network protocols, using server response codes to infer and explore a protocol's state machine. Five years after its debut, this retrospective confirms that combining state-coverage with traditional code-coverage significantly boosts the discovery of deep vulnerabilities in complex systems like TLS, SSH, and RTSP.

What Problem Does This Paper Address?

Most traditional "greybox" fuzzers (like the original AFL) are stateless. They excel at testing programs that take a single file as input, mutate it, and check for crashes. However, network servers are stateful: they expect a specific sequence of messages. For example, an FTP server won't let you delete a file until you’ve successfully logged in.

If a fuzzer doesn't understand this sequence, it spends most of its time sending "garbage" messages that the server rejects immediately, never reaching the complex logic deep within the code. This paper addresses the challenge of automatically inferring a server's internal state machine and using that model to guide the fuzzer toward unexplored states and transitions.

Methods

AFLNet introduces several novel mechanisms to handle the complexities of network protocols:

  • Automated State Model Inference: It builds an Implemented Protocol State Machine (IPSM) on the fly. It uses the response codes sent by the server (e.g., HTTP 200, FTP 230) as proxies for the server's internal state.
  • State-Aware Mutation: Instead of mutating a single file, AFLNet mutates message sequences. It splits a sequence into a prefix (to reach a specific state), a candidate subsequence (to be mutated), and a suffix (to see how the server reacts afterward).
  • Dual-Feedback Guidance: The fuzzer maintains a "bitmap" that tracks both code branch coverage and state transition coverage. It prioritizes seeds that discover new code paths or new protocol states.
  • Interleaved Seed Selection: It alternates between a standard queue-based strategy and a state-heuristic strategy, ensuring it doesn't get stuck in a "coverage plateau."

Datasets

The authors evaluated AFLNet using ProFuzzBench, a comprehensive benchmark for stateful protocol fuzzing. The evaluation covered 12 open-source subjects representing various popular protocols:

  • File Transfer: Bftpd, LightFTP, ProFTPD, Pure-FTPd.
  • Communication/Security: OpenSSH, TinyDTLS, Kamailio (SIP), Exim (SMTP).
  • Media/Network: Live555 (RTSP), DNSmasq (DNS/DHCP), DCMTK (DICOM), forked-daapd (DAAP).

Key Insights and Ideas

  • State Feedback as a Fallback: Even when source code isn't available (black-box fuzzing), state feedback alone is surprisingly effective at guiding the fuzzer. In some cases, it achieved the same branch coverage as stateless fuzzers but 4x to 6x faster.
  • The "Aha" of Interleaving: The researchers found that focusing only on state heuristics can be counterproductive. By interleaving state-based selection with AFL’s original queue-based selection, the fuzzer maintains a healthy balance between exploring the protocol logic and the underlying code implementation.
  • Response Codes are "Good Enough": While response codes are a coarse representation of a server's internal state, they provide enough signal to significantly outperform stateless fuzzers without requiring the user to write complex manual protocol specifications.

Key Results

The empirical evaluation over 24-hour runs (repeated 10 times to mitigate randomness) showed:

  • Massive State Exploration: AFLNet covered 35.67x more states on average compared to a version using only code coverage.
  • Superior Branch Coverage: AFLNet outperformed code-only baselines in 8 out of 12 subjects. For protocols like DNSmasq and OpenSSH, the state-guided approach increased state transition coverage by 95x and 325x, respectively.
  • Real-World Impact: Over five years, AFLNet has been used to uncover numerous critical vulnerabilities, including a 9.8-rated CVSS zero-day in the Live555 streaming server (CVE-2019-7314).

Limitations and Future Work

  • The Throughput Bottleneck: Network fuzzing is slow. AFLNet averages about 20 executions per second, whereas file-based fuzzers can reach thousands. This is due to network socket overhead and the need to "reset" the server state between runs.
  • Coarse State Definition: Using response codes can miss subtle state changes that don't trigger a unique code. The authors suggest that future work could use Large Language Models (LLMs) or memory snapshots to infer more granular states.
  • Environment Interaction: Current protocol fuzzers mostly focus on the network packets. However, servers also interact with file systems and databases. Expanding the "fuzzing surface" to include these environmental factors is a promising next step.

Summary updated

BibTeX
@article{meng2025aflnet,
  author = {Ruijie Meng and Van-Thuan Pham and Marcel Böhme and Abhik Roychoudhury},
  title = {{AFLNet Five Years Later: On Coverage-Guided Protocol Fuzzing}},
  journal = {IEEE Trans. Software Eng.},
  year = {2025},
  doi = {10.1109/tse.2025.3535925},
}
Figure