Skip to main content
QUICK REVIEW

[Paper Review] BertRLFuzzer: A BERT and Reinforcement Learning Based Fuzzer

Piyush Jha, Joseph K. Scott|arXiv (Cornell University)|May 21, 2023
Software Engineering ResearchComputer Science3 citations
TL;DR

BertRLFuzzer is a novel, fully automatic fuzzer that combines BERT-based language modeling with reinforcement learning to generate grammar-adhering, attack-provoking inputs for web applications without requiring manual grammar specification or labeled training data. It achieves 54% faster time to first attack and 40–60% faster discovery of all vulnerabilities compared to the nearest competing tool, demonstrating superior efficiency and effectiveness in real-world benchmarks.

ABSTRACT

We present a novel tool BertRLFuzzer, a BERT and Reinforcement Learning (RL) based fuzzer aimed at finding security vulnerabilities for Web applications. BertRLFuzzer works as follows: given a set of seed inputs, the fuzzer performs grammar-adhering and attack-provoking mutation operations on them to generate candidate attack vectors. The key insight of BertRLFuzzer is the use of RL with a BERT model as an agent to guide the fuzzer to efficiently learn grammar-adhering and attack-provoking mutation operators. In order to establish the efficacy of BertRLFuzzer we compare it against a total of 13 black box and white box fuzzers over a benchmark of 9 victim websites with over 16K LOC. We observed a significant improvement relative to the nearest competing tool in terms of time to first attack (54% less), new vulnerabilities found (17 new vulnerabilities), and attack rate (4.4% more attack vectors generated).

Motivation & Objective

  • To address the challenge of creating grammar-aware, extensible, and automatic fuzzers for web applications without requiring manual grammar definition or labeled attack data.
  • To enable automatic learning of effective mutation operators for diverse vulnerability classes (e.g., SQLi, XSS) through end-to-end training on seed inputs.
  • To reduce the time and effort required to adapt fuzzers to new applications or vulnerability types by leveraging transfer learning from pre-trained BERT models.
  • To improve fuzzer efficiency and effectiveness by using RL to guide mutation operations toward high-impact, grammar-valid attack vectors.
  • To eliminate the need for human intervention in modifying fuzzer logic when targeting new applications or vulnerability patterns.

Proposed method

  • The fuzzer uses a pre-trained BERT model to encode seed inputs and generate semantically and syntactically plausible mutations, learning input grammar implicitly from data.
  • A reinforcement learning agent, trained with a policy gradient method, selects mutation operations (e.g., insert, replace, delete) to maximize reward signals based on vulnerability detection feedback.
  • The RL agent operates in a feedback loop: each mutated input is executed against the target application, and the reward is determined by whether a vulnerability is triggered.
  • The system employs a two-stage process: initial fine-tuning of BERT on seed inputs to adapt to the target application’s input patterns, followed by RL-based exploration of the mutation space.
  • The fuzzer is extensible by replacing only the seed inputs, pre-trained BERT model, and target program—no code changes are needed for new applications.
  • The architecture enables automatic discovery of complex attack patterns by learning from simple attack vectors, even when sanitizers are in place.
Figure 1: Example of an attack
Figure 1: Example of an attack

Experimental results

Research questions

  • RQ1Can a BERT-based model learn the input grammar of a web application without explicit grammar specification?
  • RQ2Can reinforcement learning effectively guide mutation operations to discover vulnerabilities faster than traditional or ML-based fuzzers?
  • RQ3To what extent can a single fuzzer architecture be extended to multiple applications and vulnerability types with minimal human intervention?
  • RQ4How does the combination of BERT and RL improve efficiency (time to first attack) and effectiveness (attack rate) compared to state-of-the-art fuzzers?
  • RQ5Can the fuzzer discover complex, multi-part attack patterns that evade simple sanitizers, even when trained only on basic attack vectors?

Key findings

  • BertRLFuzzer reduced time to first attack by 54% compared to the nearest competing fuzzer, demonstrating superior efficiency.
  • It achieved 40–60% faster discovery of all vulnerabilities across the benchmark suite, indicating strong scalability and search efficiency.
  • The fuzzer generated 4.4% more attack vectors than the next best tool, showing higher exploitability and effectiveness.
  • The system achieved high grammar adherence without requiring manual grammar definition, learning input structure implicitly from seed inputs.
  • The fuzzer was successfully extended to multiple applications and vulnerability types with no code changes, confirming its extensibility.
  • The combination of BERT and RL enabled automatic learning of complex attack patterns, including those evading simple sanitizers, without labeled data.
Figure 2: Architecture Diagram of BertRLFuzzer
Figure 2: Architecture Diagram of BertRLFuzzer

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.