Verified Vulnerability Injection at Repository Level for Cybersecurity Agent Training
1National Institute of Standards and Technology · 2Université Grenoble Alpes, CNRS · 3University of Maryland, College Park
*Equal contribution
Despite recent advances, frontier large language model (LLM) agents remain limited in discovering and patching complex vulnerabilities in real-world software. Generally available agents can already aid attackers, who only need to find one exploitable weakness, while defenders must continuously identify and patch all vulnerabilities across fast-growing codebases. Stronger defensive agents would help close this gap, yet the scarcity of security training data with reproducible build and execution environments remains a bottleneck.
We present CyberForge, a framework that synthesizes executable, repository-level security training data by injecting vulnerabilities into real C/C++ projects. It validates each instance dynamically: the injected build must pass the project's unit tests, and a generated proof-of-vulnerability (PoV) must trigger on the injected build and not on the clean one. CyberForge is not limited by the availability of disclosed vulnerabilities, therefore it can scale in comparison to data-augmentation techniques that rely on historic CVE data. The resulting corpus holds 1,034 validated vulnerabilities across 80 projects and 63 weakness categories, with edit locality similar to real CVE patches under a real-versus-real noise floor.
Fine-tuning on trajectories collected over this corpus improves SEC-bench patch repair by +3.3 to +14.7 points, in all six configurations of three model scales and two teachers, with the 31B student reaching its GPT-5.4-mini teacher (72.7% vs. 74.0%). These gains generalize out of distribution to PatchEval, a corpus containing other programming languages, where every configuration improves and the 31B student passes its teacher.
CyberForge turns buildable OSS-Fuzz projects into training instances by injecting new weaknesses rather than mining historical disclosures, decoupling corpus growth from the rate of human discovery while keeping reproducible build and execution environments. Two complementary pipelines feed a shared oracle:
Fuzzer-guided injection uses OSS-Fuzz coverage to find sites reachable by an existing harness, so validation can lean on the harness itself. Agentic in-context injection synthesizes weaknesses beyond harness reach, combining autonomous agents, static analysis, retrieved examples of real CVE fixes, and iterative retry.
Every instance is checked by a differential PoV oracle: the clean and injected builds must both pass all unit tests, and the PoV must trigger only on the injected build. Validated (vulnerability, patch) pairs become PoV and patch tasks; teacher trajectories over these tasks fine-tune open student models into stronger security agents.
Table 1: Students fine-tuned on CyberForge trajectories at three scales and under two teachers, evaluated on SEC-bench (C/C++, in-domain) and PatchEval (Python, JavaScript, Go, out-of-distribution). Arrows give the gain over the corresponding base model.
| Model | SEC-bench (%) | PatchEval | |
|---|---|---|---|
| Strict (%) | PoV (%) | ||
| Teachers (reference) | |||
| GPT-5.4-mini | 74.0 | 13.0 | 15.2 |
| Gemma 4 31B | 58.0 | 12.2 | 14.4 |
| Gemma 4 E4B | |||
| Gemma 4 E4B base | 6.0 | 2.6 | 3.9 |
| CyberForge-E4B Gemma 4 31B | 10.7↑4.7 | 5.2↑2.6 | 6.5↑2.6 |
| CyberForge-E4B GPT-5.4-mini | 9.3↑3.3 | 9.1↑6.5 | 10.4↑6.5 |
| Gemma 4 12B | |||
| Gemma 4 12B base | 8.7 | 3.9 | 3.9 |
| CyberForge-12B Gemma 4 31B | 16.0↑7.3 | 6.1↑2.2 | 8.7↑4.8 |
| CyberForge-12B GPT-5.4-mini | 16.7↑8.0 | 12.8↑8.9 | 14.1↑10.2 |
| Gemma 4 31B | |||
| Gemma 4 31B base | 58.0 | 12.2 | 14.4 |
| CyberForge-31B Gemma 4 31B | 64.7↑6.7 | 12.4↑0.2 | 15.7↑1.3 |
| CyberForge-31B GPT-5.4-mini | 72.7↑14.7 | 14.8↑2.6 | 16.5↑2.1 |
Badges give the teacher that supervised each student. All six student–teacher configurations improve on both benchmarks; CyberForge-31B reaches its GPT-5.4-mini teacher on SEC-bench (72.7 vs. 74.0) and passes it on PatchEval.
@misc{cyberforge2026,
title = {CyberForge: Verified Vulnerability Injection at Repository Level
for Cybersecurity Agent Training},
author = {Lbath, Amine and Suri, Manan and Delaitre, Aurelien and Okun, Vadim
and Amini, Massih-Reza and Sriram, Ram D. and Manocha, Dinesh},
year = {2026},
url = {https://cyb3rforge.github.io}
}