Unleash the fuzz on your C codebase
Department of Informatics & Telecommunications, University of Athens
July 7, 2025
Result: Bugs exist
A system that:
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.
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.
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):
Interaction happens in a chat-like function. The process of querying an LLM is called prompting.
The different types of prompting techniques include:
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].
The same challenges apply when using LLMs to write fuzzing harnesses.
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.
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 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.
Not many exist ¯\_(ツ)_/¯.
C project’s git repository link ⇒ New fuzzing harness, with:
Automated process with the help of LLM agents.
src/)main, test or example substring is ignoredmain() function, or only exists in some file that is ignored by the abovegit clone--depth 1 is used for quicker downloads and less storage usageoutput/<repo-name>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.
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.
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:
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
The generated harness is executed and evaluated. The harness passes the check iff:
leak-<hash> files)crash-<hash> file) OR the harness executed for at least MIN_EXECUTION_TIME (i.e. did not crash on its own)The pipeline is not as straightforward as initially presented (Noticed the circular arrows?).
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).
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.