A Framework for Fuzz Target Generation and Evaluation

July 22, 2025 ยท View on GitHub

This framework generates fuzz targets for real-world C/C++/Java/Python projects with various Large Language Models (LLM) and benchmarks them via the OSS-Fuzz platform.

More details available in AI-Powered Fuzzing: Breaking the Bug Hunting Barrier: Alt text

Current supported models are:

  • Vertex AI code-bison
  • Vertex AI code-bison-32k
  • Gemini Pro
  • Gemini Ultra
  • Gemini Experimental
  • Gemini 1.5
  • OpenAI GPT-3.5-turbo
  • OpenAI GPT-4
  • OpenAI GPT-4o
  • OpenAI GPT-4o-mini
  • OpenAI GPT-4-turbo
  • OpenAI GPT-3.5-turbo (Azure)
  • OpenAI GPT-4 (Azure)
  • OpenAI GPT-4o (Azure)

Generated fuzz targets are evaluated with four metrics against the most up-to-date data from production environment:

  • Compilability
  • Runtime crashes
  • Runtime coverage
  • Runtime line coverage diff against existing human-written fuzz targets in OSS-Fuzz.

Here is a sample experiment result from 2024 Jan 31. The experiment included 1300+ benchmarks from 297 open-source projects.

image

Overall, this framework manages to successfully leverage LLMs to generate valid fuzz targets (which generate non-zero coverage increase) for 160 C/C++ projects. The maximum line coverage increase is 29% from the existing human-written targets.

Note that these reports are not public as they may contain undisclosed vulnerabilities.

Usage

Check our detailed usage guide for instructions on how to run this framework and generate reports based on the results.

Independent Agent Execution and Evaluation

You can also execute or evaluate individual agents without running full experiments, using the integrated agent execution framework. See the framework's documentation for detailed instructions on how to run individual agents or sequence of agents.

Collaborations

Interested in research or open-source community collaborations? Please feel free to create an issue or email us: oss-fuzz-team@google.com.

Bugs Discovered

So far, we have reported 30 new bugs/vulnerabilities found by automatically generated targets built by this framework:

ProjectBugLLMPrompt BuilderTarget oracle
cJSONOOB readVertex AIDefaultFar reach, low coverage
libplistOOB readVertex AIDefaultFar reach, low coverage
hunspellOOB readVertex AIdefaultFar reach, low coverage
zstdOOB writeVertex AIdefaultFar reach, low coverage
gdbmStack buffer underflowVertex AIdefaultFar reach, low coverage
hoextdownUse of uninitialised memoryVertex AIdefaultFar reach, low coverage
pjsipOOB readVertex AIDefaultLow coverage with fuzz keyword + easy params far reach
pjsipOOB readVertex AIDefaultLow coverage with fuzz keyword + easy params far reach
gpacOOB readVertex AIDefaultLow coverage with fuzz keyword + easy params far reach
gpacOOB read/writeVertex AIDefaultAll
gpacOOB readVertex AIDefaultAll
gpacOOB readVertex AIDefaultAll
sqlite3OOB readVertex AIDefaultAll
htslibOOB readVertex AIDefaultAll
libicalOOB readVertex AIDefaultAll
croaringOOB readVertex AITest-to-harnessAll
opensslCVE-2024-9143 - OOB read/writeVertex AIDefaultAll
liblouisUse of uninitialised memoryVertex AITest-to-harnessTest identifier
libuclOOB readVertex AIDefaultLow coverage with fuzz keyword + easy params far reach
openbabelUse after freeVertex AIDefaultLow coverage with fuzz keyword + easy params far reach
libyangOOB readVertex AIDefaultAll
openbabelOOB readVertex AIDefaultAll
exiv2OOB readVertex AIDefaultAll
UndisclosedJava RCE (pending maintainer triage)Vertex AIDefaultFar reach, low coverage
UndisclosedRegexp DoS (pending maintainer triage)Vertex AIDefaultFar reach, low coverage
UndisclosedOOB readVertex AIDefaultAll
UndisclosedOOB writeVertex AIDefaultAll
UndisclosedOOB readVertex AIDefaultAll
UndisclosedOOB readVertex AIDefaultAll
UndisclosedUse after freeVertex AIAgent promptAll

These bugs could only have been discovered with newly generated targets. They were not reachable with existing OSS-Fuzz targets.

Current top coverage improvements by project

ProjectTotal coverage gainTotal relative gainOSS-Fuzz-gen total covered linesOSS-Fuzz-gen new covered linesExisting covered linesTotal project lines
phmap98.42%205.75%160111815741120
usbguard97.62%26.04%245505463209793564
onednn96.67%7057.14%5434543477210
avahi82.06%155.90%3358281418053046
pugixml72.98%194.95%9015664634097662
librdkafka66.88%845.57%501944905311169
casync66.75%903.23%117111201241678
tomlplusplus61.06%331.10%4755365211035981
astc-encoder59.35%177.88%272617459812940
mruby48.56%0.00%3449334493071038
arduinojson42.10%85.80%3344180020984276
json41.13%66.51%5051333950208119
double-conversion40.40%88.12%16637798841928
tinyobjloader38.26%77.01%11577179311874
glog38.18%58.69%895331564867
cppitertools35.78%45.07%253151335422
eigen35.38%190.70%2643194710215503
glaze34.55%30.06%2920241680366993
rapidjson31.83%148.07%15859586473010
libunwind30.58%83.25%2899134216124388
openh26430.07%50.14%660757511147019123

* "Total project lines" measures the source code of the project-under-test compiled and linked by the preexisting human-written fuzz targets from OSS-Fuzz.

* "Total coverage gain" is calculated using a denominator of the "Total project lines". "Total relative gain" is the increase in coverage compared to the old number of covered lines.

* Additional code from the project-under-test maybe included when compiling the new fuzz targets and result in high percentage gains.

Citing This Work

Please click on the 'Cite this repository' button located on the right-hand side of this GitHub page for citation details.