OverHAuL: Harness Automation with LLMs

Unleash the fuzz on your C codebase

Konstantinos Chousos

Department of Informatics & Telecommunications, University of Athens

July 7, 2025

Introduction

Motivation

  • Memory unsafety is and will be prevalent
  • Software is safe until it’s not
  • Humans make mistakes
  • Humans now use Large Language Models (LLMs) to write software
  • LLMs make mistakes

Result: Bugs exist

Goal

A system that:

  1. Takes a bare C project as input
  2. Generates a new fuzzing harness from scratch using LLMs
  3. Compiles it
  4. Executes it and evaluates it

Overview

  1. Introduction
  2. Background
  3. Related work
  4. OverHAuL
  5. Results
  6. Future work
  7. Discussion/Conclusion

Background

Fuzzing

Fuzzing

What is fuzzing? [1]

Overview of a fuzz campaign.

Overview of a fuzz campaign.

Fuzzing

Why fuzz?

The purpose of fuzzing relies on the assumption that there are bugs within every program, which are waiting to be discovered. Therefore, a systematic approach should find them sooner or later.

— OWASP Foundation

Fuzzing

Success stories

  • Heartbleed vulnerability, OpenSSL [2] (CVE-2014-0160)
    • Easily found with fuzzing ⇒ Preventable
  • Shellshock vulnerabilities, Bash (CVE-2014-6271)
  • Mayhem (FKA ForAllSecure) [3]
    1. Cloudflare
    2. OpenWRT

Fuzzing

Fuzzer implementations

  • LibFuzzer [4].
    • In-process, coverage-guided, mutation-based fuzzer.
  • American Fuzzy Lop (AFL) [5].
    • Instrumented binaries for edge coverage.
    • Adds more fuzzing strategies, better speed, and QEMU/Unicorn support.
    • Superseded by AFL++ [6].

LibFuzzer

Fuzz target/harness

Fuzz target

A function that accepts an array of bytes and does something interesting with these bytes using the API under test [4].

AKA fuzz driver, fuzzer entry point, harness.

LibFuzzer

Harness structure

  • Entry point called repeatedly with mutated inputs.
  • Feedback-driven: uses coverage to guide mutations.
  • Best for libraries, not full programs.
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
  DoSomethingWithData(Data, Size);
  return 0;
}

Fuzzing

Difficulties

  • Relatively unknown practice, especially compared to TDD
  • Upfront cost of writing harnesses
  • Cost of examining and evaluating crashes

Large Language Models (LLMs)

LLMs

Machine Learning (ML) models trained on vast amounts of data, implemented through transformers [7].

Most powerful and well-known LLMs are Generative-Pretrained-Transformers (GPTs):

  • Closed source: OpenAI’s ChatGPT, Anthropics’ Claude and Google’s Gemini [8], [9], [10].
  • Open “source”1: Meta’s Llama3, Deepseek’s Deepseek-R1 cite: [11], [12].

LLMs

Prompting

Interaction happens in a chat-like function. The process of querying an LLM is called prompting.

LLMs

Prompting

The different types of prompting techniques include:

  1. Zero-Shot
  2. Few-Shot [13]
  3. RAG [14]
  4. Chain of Thought [15]
  5. Tree of Thought [16]
  6. ReAct [17]

LLMs

For programming

In recent years, LLMs have disrupted the world of software engineering.

Both web-based interfaces and AI-assisted IDEs [18], [19] have seen exponential growth in popularity and adoption.

These developments have converged in the creation of a new type of software engineering: Vibecoding [20].

LLMs

Challenges in programming

  1. Knowledge limited to training data → Hallucinations
  2. Limited context window → Inapplicable to large codebases

The same challenges apply when using LLMs to write fuzzing harnesses.

Neurosymbolic AI

Neurosymbolic AI (NeSy AI)

What is it?

AI systems that integrate neural and ML methods with symbolic execution systems and tools [21].

A more accurate and robust cognitive model for problem solving.

NeSy AI

What does it solve?

In regards to LLMs and established AI practices, NeSy AI is seen as the answer to explainability, attribution and reliability problems that we face today [22], [23].

NeSy AI

What’s its state?

NeSy AI as a research is still in its adolescence.

In fuzzing in particular, there are only a few tools developed that combine ML methodologies and symbolic systems for harness generation.

Automated fuzzing/testing

  1. KLEE [24]: Symbolic execution tool designed to automatically generate high-coverage test cases.
  2. FUDGE [25]: Closed-source program for automatic harness generation of C/C++ projects based on existing client code.
  3. FuzzGen [26]: Automatic harness generation through whole system analysis. Uses programs using the API under test to generate a dependency graph of the API functions.

LLM-assisted fuzzing

  1. IRIS [27]: Neurosymbolic system using LLMs for static analysis, based on user-provided CWEs.
  2. ProphetFuzz [28]: LLM-assisted fuzzing for option combinations.
  3. OSS-Fuzz-Gen [29]: Automatic generation of harnesses for OSS-Fuzz projects [30]. Preexisting harnesses needed.

Not many exist ¯\_(ツ)_/¯.

OverHAuL

Overview

Overview

C project’s git repository link ⇒ New fuzzing harness, with:

  1. Working crash input
  2. Compilation shell script
  3. Logged output

Automated process with the help of LLM agents.

How is it different?

  1. No prior fuzzing infrastructure is required
  2. Straight-forward installation process
  3. Harness generation through iterative improvements and runtime evaluation
  4. Decoupled from other fuzzing projects

Research questions

Research questions

  • RQ1: Can OverHAuL generate working harnesses for unfuzzed C projects?
  • RQ2: What characteristics do these harnesses have? Are they similar to man-made harnesses?
  • RQ3: How do different LLM techniques influence the generated harnesses?
  • RQ4: How do different symbolic techniques affect the generated harnesses?

Scope

Scope

  • Limited to C libraries
  • Expects relatively simple project structure
    • Code either in root or in common-named subdirs (e.g. src/)
    • Any file or directory with main, test or example substring is ignored
    • No main() function, or only exists in some file that is ignored by the above
  • Build systems not supported
    • Harness is compiled with a predefined command

Architecture/Pipeline

Step 1: Repo cloning

  • Simple git clone
  • --depth 1 is used for quicker downloads and less storage usage
  • Cloned repo now exists in output/<repo-name>

Step 2: Static analysis

Flawfinder [32] is executed with the project directory as input.

This step provides the LLM with some starting points to explore, regarding usage of potentially vulnerable functions etc.

Step 3: Code chunking and vector store

Source code of the given project is chunked in function-level units.

Each unit is turned into an embedding and stored in a vector store.

Step 4: Initial harness generation

A ReAct LLM agent is called to create a new harness for the given project.

It has access to a tool acting as a frontend to the vector store. The agent can make queries such as “Functions that use strcpy() in their code” and the tool will:

  1. Turn the query to an embedding
  2. Use that to perform a search on the vector store
  3. Return the top 5 most relevant results to the agent

Step 5: Harness compilation

After a harness has been generated, it is written in harnesses/harness.c, relative to the given project’s root.

It then is compiled, with the compilation command being of the following form:

clang -g3 -fsanitize=fuzzer,address,undefined,leak harnesses/harness.c <relevant .c files> -I <relevant dirs with header files> -o harness

Step 6: Harness evaluation

The generated harness is executed and evaluated. The harness passes the check iff:

  1. There are no memory leaks (i.e. no leak-<hash> files)
  2. A new testcase was created (i.e. a new crash-<hash> file) OR the harness executed for at least MIN_EXECUTION_TIME (i.e. did not crash on its own)
  3. The created testcase is not empty

Techniques used

Feedback loop

The pipeline is not as straightforward as initially presented (Noticed the circular arrows?).

  1. If the generated harness doesn’t compile, an LLM agent is called to fix it — given it’s compilation error.
  2. If the generated harness doesn’t pass the evaluation, an LLM agent is called to improve it — given it’s output and the reason that it fails.
    • If the improved harness doesn’t compile, it is yet again sent to the previous agent.

Vector store for code exploration

Source code is processed and chunked using Clang [33]. The chunks are function-level units, found to be a sweet-spot between semantic significance and size [34], [35].

This results in a list of Python dicts, each containing a function’s body, signature and filepath.

Each chunk’s function code is then turned into an embedding using OpenAI’s “text-embedding-3-small” model.

A FAISS [36] vector store is created. Each function embedding is stored in it (with the same order, as to correspond with the previous list containing the metadata).

LLM triplets

Instead of one LLM agent being responsible for the whole process, each of the three agents have one specific task.

This allows more exploration per run, e.g. the improver agent might explore a different path that the generator agent had rejected.

Also keeps context window limitations manageable, since they are shared between the agents.

Accurate flowchart