VulnRepairEval: An Exploit-Based Evaluation Framework for Assessing Large Language Model Vulnerability Repair Capabilities

Weizhe Wang, Wei Ma, Qiang Hu, Yao Zhang, Jianfei Sun, Bin Wu, Yang Liu, Guangquan Xu, Lingxiao JiangarXiv 2025 · DOI

Introduction

Large Language Models (LLMs) are increasingly being integrated into software development workflows to automate program repair. However, security vulnerabilities present a unique challenge: a patch that passes standard unit tests or compiles successfully may still leave the underlying exploit surface wide open. Current benchmarks often overestimate LLM capabilities by relying on superficial validation methods. This paper introduces VulnRepairEval, a rigorous evaluation framework designed to test whether LLM-generated patches actually neutralize real-world Proof-of-Concept (PoC) exploits.

The VulnRepairEval Framework

To move beyond simple syntax checking, the authors developed an end-to-end, reproducible evaluation pipeline. The framework utilizes a containerized differential setup to compare the behavior of vulnerable and patched code under attack.

The VulnRepairEval pipeline architecture, featuring Patch Generation, Automatic Deployment, and Runtime Injection modules.

As shown in the architecture above, the system spins up isolated Docker environments for both the original and patched versions of a project. A patch is only considered successful if the PoC exploit succeeds on the baseline but fails on the patched build, ensuring the security flaw is truly addressed rather than just masked.

The Benchmark Dataset

The authors curated the VulnRepairEval benchmark, a high-quality dataset of 23 real-world Python CVEs spanning from 2017 to 2024. These vulnerabilities were selected from an initial pool of over 400 candidates and manually verified to ensure they included executable PoC scripts.

Distribution of vulnerability categories within the VulnRepairEval benchmark dataset, highlighting diversity across nine security flaw types.

The dataset covers nine distinct vulnerability categories, including Command Injection, Cross-Site Scripting (XSS), and Denial of Service. This diversity ensures that models are tested against a wide range of attack vectors common in modern web applications.

Key Insights and Experimental Results

Testing 12 leading LLMs—including GPT-4o, Gemini 2.5, and DeepSeek—revealed a significant capability gap in automated security repair:

  • Dismal Overall Performance: The top-performing model, Gemini 2.5 Pro, successfully repaired only 21.7% (5 out of 23) of the vulnerabilities. Several state-of-the-art models failed to produce even a single validated fix.
  • Localization as the Primary Bottleneck: The majority of failures (60–78%) were due to the models' inability to correctly identify the location of the flaw within the source code, rather than an inability to write the fix itself.
  • The Advantage of "Thinking" Models: Models that externalize their reasoning process, such as DeepSeek R1 and Qwen3 235B Thinking, significantly outperformed standard models. This suggests that vulnerability repair requires complex multi-step decomposition that intuitive, single-pass models struggle to achieve.
  • Conservative Bias: Many models exhibited a "conservative bias," frequently claiming no vulnerability was found. While this reduces false positives in code modification, it creates a dangerous false sense of security in a production environment.

Conclusion and Future Work

VulnRepairEval demonstrates that current LLMs are far from reliable for automated security patching. While agentic frameworks and reasoning-focused models show promise in improving detection and localization, generating logically complete and robust patches remains a major hurdle. Future work will involve expanding the framework to support other languages like C/C++ and Java, and integrating additional validation layers such as static analysis and fuzzing to ensure patches are resilient against variations of the original exploit.

Summary updated

BibTeX
@misc{wang2025vulnrepaireval,
  author = {Weizhe Wang and Wei Ma and Qiang Hu and Yao Zhang and Jianfei Sun and Bin Wu and Yang Liu and Guangquan Xu and Lingxiao Jiang},
  title = {{VulnRepairEval: An Exploit-Based Evaluation Framework for Assessing Large Language Model Vulnerability Repair Capabilities}},
  year = {2025},
  eprint = {2509.03331},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.03331},
}
Figure