Computer security researchers have developed AFLDL, an experimental greybox protocol fuzzing framework that applies deep learning to runtime memory snapshots to infer internal protocol states and discover previously hidden operational transitions. Stateful network protocols govern communications across modern computer networks, but evaluating their software implementations for security flaws has remained a persistent technical bottleneck because a server’s reaction depends not only on an incoming message but also on the internal session state accumulated over preceding exchanges. Traditional coverage-guided fuzz testing tools generate mutated inputs to trigger code paths without adequate semantic insight into these protocol states, whereas existing stateful greybox fuzzers typically infer state transitions through heuristic rules, output response codes, or isolated variables that struggle to reflect complex multi-variable conditions. The research demonstrates that pairing neural representation learning with prototype clustering enables a fuzzer to construct and enrich state machines directly from live memory contexts, increasing branch exploration and vulnerability detection across standard security protocol suites.
The foundational challenge in evaluating stateful security protocols stems from their direct exposure to untrusted network environments, where minor logical discrepancies or memory safety errors can introduce critical systemic risks. Attackers can deliberately manipulate message sequences to bypass authentication controls, exfiltrate private data, or induce memory corruption crashes in server software. While basic fuzz testing iteratively mutates initial seed inputs and monitors for novel execution paths or crashes, protocols incorporating encryption and session authentication react differently to identical inputs depending on their active session phase. Stateful blackbox fuzzing attempted to overcome this limitation by requiring human operators to supply a deterministic finite automaton to steer test generation; however, blackbox approaches cannot retain inputs that expose novel internal behaviors outside the predefined model. Subsequent stateful greybox tools attempted to reconstruct state transitions dynamically from input-output sequences or lightweight memory checks, but their reliance on shallow heuristics frequently produced inaccurate state representations that conflicted with formal protocol logic.
To overcome these structural limitations, the authors structured AFLDL around four sequential stages comprising blackbox model learning, training data generation, neural network training, and active fuzzing. In the initial stage, researchers use blackbox active model learning to extract a formal Mealy machine of the target implementation, establishing an initial structural baseline that represents domain knowledge. The Mealy machine formally captures inputs, outputs, states, and transition relations verified through equivalence queries and counterexample identification algorithms. From this learned automaton, the framework extracts valid execution paths leading to each identified state. An intermediate mapper translates these abstract sequences into concrete network messages that are dispatched to the system under test, while an execution monitor records runtime snapshots of global variables and dynamic heap allocations, generating a labeled training dataset of paired memory states and formal state identifiers.
Transforming raw runtime memory into a format suitable for neural feature extraction required specialized preprocessing to handle the dynamic behavior of operating system memory allocators. In standard systems using ptmalloc2, dynamic allocations are tracked through heap chunks that include a sixteen-byte metadata header followed by user data, while identical logical variables may be placed at varying memory offsets across executions. AFLDL parses heap metadata to recover chunk boundaries without requiring source-code debug symbols or static type declarations, discarding allocator headers and retaining contiguous user data segments exceeding sixteen bytes. The gathered bytes are normalized into numerical values within the range of zero to two hundred fifty-five and mapped into square matrices. To prevent the loss of allocation boundaries during vectorization, the authors implemented an entity encoding mechanism that samples a sinusoidal wave function across the sequence of heap units, enabling the neural network to preserve relative structural relationships among separate memory objects.
Because raw training traces generated solely from standard state paths do not capture the erratic memory fluctuations encountered during live fuzzing campaigns, the researchers introduced two distinct data augmentation strategies. Under bounded-depth path traversal, the pipeline explores alternative routing sequences within the state automaton to collect varied memory snapshots for identical target states. Under mutated input execution, the system guides the target server to a known state using valid sequences and then delivers randomly mutated messages, testing whether the server preserves its expected state behavior while recording the resulting variations in memory layout. This augmentation pipeline expands the diversity of the training corpus, preparing the underlying model to distinguish genuine state transitions from incidental heap noise caused by malformed protocol inputs.
The core inferential architecture of AFLDL is built on a ResNet50 neural network trained with mini-batch stochastic gradient descent and the ADAMAX optimization algorithm. The network projects preprocessed memory snapshots into a one-hundred-twenty-eight-dimensional embedding space using a compound objective function. A contrastive loss term brings representations from the same protocol state closer to an anchor sample while pushing representations from differing states apart, governed by a temperature scaling parameter. Concurrently, a structure-aware autoencoder reconstruction loss forces the model to reconstruct the sinusoidal instance embeddings from the latent representation, ensuring the network focuses on persistent structural heap properties rather than transient data values. Once trained, the system calculates prototype vectors by averaging the feature representations across all training snapshots belonging to each respective state class.
During active fuzz testing, AFLDL monitors execution states with minimal performance degradation by placing strategic hooks on data transmission system calls. When the target server produces an output, the monitor captures a memory snapshot during the write system call, avoiding any need to parse network output contents or decrypt encrypted payloads. When the server produces no output, snapshots are triggered either during the subsequent read call or immediately prior to terminating the process. The captured snapshot is converted into a feature vector by the representation network and compared against the repository of established prototype centers.
The authors implemented an operational prototype consisting of two thousand lines of C and C++ modifying the core logic of AFLNet, alongside more than ten thousand lines of Python supporting model learning and neural network training in PyTorch. The experimental evaluation examined eight real-world implementations spanning TLS 1.2, TLS 1.3, IPsec IKEv1, and IPsec IKEv2 across OpenSSL, WolfSSL, strongSwan, and Libreswan stacks. In standalone classification benchmarks using five-fold cross-validation across five hundred snapshots per state, the representation network achieved classification accuracy exceeding ninety-six percent on known states and surpassed ninety percent accuracy when identifying previously unseen states, demonstrating that the learned feature representations capture transferable structural indicators of protocol status.
Across repeated twenty-four-hour fuzzing campaigns conducted on uniform containerized hardware with one hundred twelve processor cores, AFLDL consistently outperformed existing tools in code exploration. Relative to baseline AFLNet, AFLDL achieved an average increase of positive six point sixty-six percent in code branch coverage across all eight targets. An ablation variant designated AFLDL-V, which employed the static model-learned state machine but disabled runtime discovery of new states, averaged a decline of negative one point sixty percent relative to AFLNet, illustrating that static state models without adaptive runtime refinement leave extensive functional paths unexplored. In contrast, the blackbox tool Peach recorded an average coverage deficit of negative one point seventy-four percent, while ChatAFL recorded an average decline of negative eight point seventy-six percent, reflecting difficulties in generating valid binary sequences from specification prompts alone. NSFuzz achieved an average gain of positive one point seventy-four percent, and PSG combined with AFLNet achieved positive two point sixty-four percent, both remaining below AFLDL’s exploration depth.
To evaluate state-space exploration beyond traditional source code coverage metrics, the researchers utilized state-variable instrumentation from NSFuzz to measure the proportion of reachable internal state variables triggered during testing. AFLDL exercised an average of eighty-five point four percent of reachable state-variable configurations across the eight protocol targets, surpassing the next-best tools by twenty-three percentage points. Baseline fuzzers showed clustered results, with StateAFL reaching sixty-three point nine percent, AFLNet reaching sixty-three point four percent, and the ablation fuzzer AFLDL-V reaching sixty-two point three percent, while the network fork-server variant AFLNwe reached fifty-four point nine percent due to kernel networking overheads. A concrete examination of strongSwan IKEv1 demonstrated that AFLDL isolated a previously unobserved state, designated s10, arising from a malformed Nonce parameter within a MainMode2 exchange, whereas response-code and locality-sensitive hashing methods conflated the failure with earlier operational states.
The researchers further evaluated real-world vulnerability discovery using historical flaw benchmarks from the Magma framework transplanted into OpenSSL, combined with historical vulnerabilities collected from IPsec implementations and WolfSSL. AFLDL maintained testing throughput comparable to AFLNet throughout the twenty-four-hour campaigns, demonstrating that periodic system call snapshotting and lightweight neural inference did not introduce substantial execution latency into the primary fuzzing loop.
Despite its demonstrated performance advantages, the authors documented several technical constraints and threats to validity. The current experimental setup operated in single-process, single-session environments with address space layout randomization disabled to ensure reproducible memory baselines, meaning application to production-scale multi-threaded servers will require additional mechanisms for snapshot attribution and address normalization. Furthermore, state representation accuracy depends on structural consistency; without entity encoding, irregular heap layouts in encrypted sessions reduced classification F1 scores by roughly ten point five percentage points. Synthetic scaling evaluations on strongSwan IKEv2 revealed that expanding target models from thirteen to fifty states caused F1 scores to decline from ninety-seven point eight percent to eighty-three point eight percent due to prototype crowding in embedding space. The researchers noted that while runtime discovery compensates for moderately coarse RFC-based initial models, addressing state aliasing and extending snapshot attribution to concurrent network architectures remain key priorities for future engineering.
Subject of Research: Deep learning-guided stateful greybox fuzzing for network security protocols
Article Title: AFLDL: state-aware greybox protocol fuzzing based on deep learning
Article References: Ju, M., Chen, X., Zhang, X., Tian, K., Wang, Y., & Gu, C. (2026). AFLDL: state-aware greybox protocol fuzzing based on deep learning. Cybersecurity, 9(1), Article 253. https://doi.org/10.1186/s42400-026-00688-y
Image Credits: AI Generated
DOI: 10.1186/s42400-026-00688-y
Keywords: network security, protocol fuzzing, greybox fuzzing, deep learning, memory snapshots, state machine inference, vulnerability discovery, contrastive learning, representation learning, software testing, AFLDL, state-aware
News Source: Blake Davidson. (November 9, 2026). Deep Learning Maps Memory Snapshots to Advance Stateful Greybox Protocol Fuzzing. Scienmag.



