Enhancing Protocol Fuzzing via LLM-Generated Semantic-Aware Mutators

Keyi Wang, Yiutak Choi, Pengda Li, Chijin Zhou, Haiying Sun, Chengcheng Wan, Ting Su, Geguang PuarXiv 2026

TL;DR

Standard network protocol fuzzers hunt for bugs by blindly scrambling bytes, which means ~97% of their test messages get rejected at the front door for breaking basic protocol rules. LEMUR-Fuzz solves this by using an LLM offline to read protocol specifications and write custom C code that mutates messages intelligently—respecting field meanings and repairing cross-field dependencies. By pairing this polite, rule-abiding exploration with traditional chaotic byte-mangling, it reaches deep software states and uncovers bugs (including a brand-new vulnerability in Mosquitto) that existing tools miss.

What Problem Does This Paper Address?

Network protocols (like SSH, TLS, or MQTT) are the plumbing of the internet, translating dense specification documents (RFCs) into complex, stateful C code. Finding bugs in them is critical—remember Heartbleed?—and mutation-based fuzzing is our best automated tool for the job. A fuzzer takes a valid sequence of client-to-server messages (a "seed"), mutates it, and fires it at the server to see if anything crashes.

The catch is that standard fuzzers (like the flagship tool AFLNet) mutate raw, unstructured byte streams using blind operations like bit-flipping. Protocols, however, have strict rules. Flipping a random bit might corrupt a fixed header or clear a Password Flag while leaving the Password payload intact.

Examples of blind mutations breaking field semantics and cross-field rules in MQTT.

When the authors tested AFLNet on the popular MQTT broker Mosquitto, they found that 97% of mutated messages failed validation and were rejected before reaching core execution logic. Hand-writing custom, rule-aware mutators for every protocol takes immense manual effort, while asking an LLM to generate test inputs live during fuzzing is slow and expensive.

Methods

Instead of putting an LLM in the hot fuzzing loop, the authors use GPT-5 in a one-time, pre-fuzzing phase to read RFC specifications and synthesize four C-language components per protocol:

  1. Message Templates: Structs defining message fields, tagged as Fixed, Optional, or Repeatable.
  2. Parser & Reassembler: Code to lift raw bytes into structured templates and serialize them back.
  3. Semantic-Aware Mutators: Functions that mutate specific fields across eight meaningful dimensions (e.g., boundary lengths, valid UTF-8 encodings, or protocol-specific paths like $SYS/).
  4. Constraint Fixers: Repair functions that fix broken cross-field or inter-message rules in place (e.g., if a Will Flag is enabled during mutation, the fixer automatically inserts missing Will payload fields).
Fig. 3. The process of synthesizing four protocol-specific components via LLM and performing quality checking on these components.

Because LLMs hallucinate, the authors built three automated quality checkers before fuzzing begins:

  • A metamorphic test checks that reassemble(parse(Msg)) == Msg.
  • A parseability test runs random mutators 500 times to ensure outputs still parse cleanly (failing mutators are simply discarded).
  • A constraint-violation test deliberately breaks rules to verify the fixers actually repair them.

Finally, LEMUR-Fuzz integrates these components as a new stage alongside AFLNet's original mutators. Each seed first undergoes semantic mutation to explore deep protocol states, and then gets handed to AFLNet’s chaotic byte-mutators to probe edge cases around those states.

Datasets

The authors evaluated LEMUR-Fuzz across 12 widely used server implementations spanning 10 protocols: MQTT (Mosquitto, NanoMQ), RTSP (live555), SIP (Kamailio), FTP (ProFTPD, Pure-FTPd), SMTP (Exim), DTLS (TinyDTLS), DNS (dnsmasq), DICOM (DCMTK), TLS (OpenSSL), and SSH (OpenSSH). This covers every protocol with a public RFC in the standard ProFuzzBench benchmark (excluding only proprietary DAAP), using seed corpora from ProFuzzBench and AFLNet tutorials.

Key Insights and Ideas

  • Polite exploration + chaotic exploitation are complementary: Neither semantic mutation nor blind byte-flipping is enough on its own. Semantic mutators act like a keycard to get past strict parser gates into deep state machines (like configuring a valid teardown routine), where traditional byte-mangling can then trigger memory corruption.
  • Offline code synthesis beats online LLM prompting: Generating all C components for the entire 10-protocol benchmark cost ~$26 once, whereas running an online LLM fuzzer (ChatAFL) costs ~$12 per 24-hour run—and LEMUR-Fuzz adds just 25 microseconds of local overhead per execution.
  • Mutators need fixers to shine: Ablation studies showed that fixing constraints alone barely helps (+1.94% coverage) because blind byte flips destroy message structure before fixers can even run. Semantic mutators (+4.53%) and fixers work best together (+6.93%), creating diverse values while keeping cross-field logic intact.

Key Results

  • Message Validity: Across all 12 targets, average server-side execution success jumped from 15.4% (AFLNet) to 43.8% (a +576.3% relative increase across targets—including jumping from 7.5% to 83.4% on NanoMQ).
  • Code Coverage: Over 24-hour runs, LEMUR-Fuzz improved average branch coverage by 6.93% over AFLNet across all 12 targets, and 5.28% over ChatAFL on text-based protocols (ChatAFL cannot handle binary protocols).
  • Bug Discovery: On older, known-vulnerable benchmarks, LEMUR-Fuzz found 14 unique crashes compared to AFLNet's 11. On the latest production codebases, LEMUR-Fuzz discovered a previously unknown NULL-pointer dereference in Mosquitto—triggered during broker teardown only when a valid MQTT Will configuration is established—which developers confirmed and fixed.

Limitations and Future Work

  • Not zero-human-effort: Message templates require ~10 minutes of manual review per protocol, and when automated checkers flag bugs in LLM-generated parsers or fixers, a human spends 30 minutes to 2 hours repairing the C code (a one-time setup cost per protocol).
  • Reliance on public specs: The pipeline requires written protocol specifications (like RFCs), meaning proprietary, undocumented protocols (like DAAP) are out of reach.
  • Cryptographic & auth gates: Gains were smallest on targets like OpenSSL (+0.58%) and OpenSSH (+2.90%), where deeper code paths are locked behind cryptographic handshakes, encryption, and strict authentication rather than message-format checks alone. (Future directions are not explicitly discussed in the paper.)

Summary updated

BibTeX
@misc{wang2026enhancing,
  author = {Keyi Wang and Yiutak Choi and Pengda Li and Chijin Zhou and Haiying Sun and Chengcheng Wan and Ting Su and Geguang Pu},
  title = {{Enhancing Protocol Fuzzing via LLM-Generated Semantic-Aware Mutators}},
  year = {2026},
  eprint = {2611.36867},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.36867},
}
Figure