VeriVul: A Verification-Guided Framework for Generating Realistic Vulnerability Benchmarks
Ahmed Lekssays, Hamza Mouhcine, Issa Khalil
NeurIPS page · Open on the map
Category: AI Safety, Security & Alignment › Agent Security Benchmarks · Type: new method · Keywords: vulnerability benchmark, formal verification, code LLM, ESBMC, program slicing, contamination-resilient evaluation
Areas: Safety & Security › Cybersecurity › Vulnerability Detection; Evaluation & Benchmarks › Language Model and Agent Benchmarks › Formal Verification Benchmarks
Summary
VeriVul is a verification-guided framework that creates formally verified vulnerability benchmarks from CVE-fixing commits, using a code LLM to expand relevant code fragments and ESBMC to certify labels and counterexamples.
Explained to a 5-year-old
People want to find bugs in computer code that stops bad programs. Existing lists of bugs are either not accurate or not realistic. This new system looks at a fix for a known bug, picks out the important part of the code, and uses a special checker to make sure the bug really exists. It also makes a safe version of the code that does not have the bug. This helps test AI programs that look for bugs.
Explained to a 5-year-old, longer
Imagine you have a puzzle where you need to find hidden mistakes in a computer program. Right now, the puzzles we have are either full of wrong answers or too easy, so they don’t really test the AI well. The new system starts with a real fix for a security bug, like when a programmer corrects a problem in the code. It then uses a clever tool to pull out just the part of the code that caused the bug. After that, it asks a smart AI that writes code to turn that small piece into a full, working program. The system then runs a very careful checker that proves whether the program really has the bug or not, and it also saves the exact step that shows the problem. For each buggy program, the system also creates a safe version that does the opposite, so we have both examples. The resulting collection of programs is more like real-world code, with lots of different structures and tricks, making it a tough test for AI that looks for bugs. Finally, the creators share all the tools and the new collection so other researchers can test their AI without worrying that the AI has already seen the test cases before.
For a technical reader
The system ingests a CVE-fixing commit, isolates the vulnerability-relevant code slice via a backward slicer, and expands it into a complete program using a code-generation LLM. The generated program is formally verified with ESBMC, producing a verified label and a counterexample trace; a counterpart with the opposite label is also generated. This yields a benchmark where each sample is realistic, formally validated, and includes explanatory traces for deeper evaluation.
Problem
Evaluating machine-learning vulnerability detectors needs realistic code with accurate labels, but existing benchmarks either have noisy labels or overly simple synthetic code, and static datasets risk being memorized by code LLMs.
Method
The approach takes a CVE-fixing commit, applies a vulnerability-aware backward program slicer to isolate the relevant code fragment, expands it into a self-contained program using a code LLM, and verifies the program with a bounded model checker (ESBMC) to obtain a verified label and counterexample trace. It also generates a verified counterpart with a flipped label for each sample.
Results
The approach obtains only 52.6% accuracy for Claude Opus 4.7 on the benchmark despite being given the full program, and the generated samples are more realistic than prior synthetic baselines according to structural metrics.
Contributions
The paper introduces a framework that automatically creates formally verified vulnerability benchmarks from CVE-fixing commits, combining code LLMs with bounded model checking to produce realistic, verified code and counterexamples, and releases the framework, slicer, verification harness, and dataset for contamination-resilient evaluation.
Practical relevance
The framework enables reliable, contamination-resilient evaluation of code LLMs for vulnerability detection, providing realistic benchmarks and verification tools for security researchers.
This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction