P2Patch: Exploit-Guided Vulnerability Repair
Mohsen Iranmanesh, Sina Moradi Sabet, Sina Marefat, Ali Javidi Ghasr, Maxime Newman Nereyabagabo, Kousha Amouzesh, Jaivir Malhi, Vinci Velasco,
Key points
From the paper's conclusion- We present P2Patch, a generative adversarial repair system that treats each patch as a new attack target.
Abstract
Large language models are increasingly deployed as autonomous agents for automated program repair, patching software vulnerabilities through multi-step reasoning and tool use. Yet these systems typically validate a patch against the same evidence used to construct it -- a static alert, sanitizer trace, published exploit, or test suite. A patch that blocks that one piece of evidence can therefore look successful while remaining vulnerable to the same vulnerability with some variation. We present P2Patch, a generative adversarial repair system that treats each patch as a new attack target. Starting from a normalized vulnerability finding, an exploitation agent constructs a reproducing proof of vulnerability (PoV), a patching agent repairs the program, and the exploitation agent then attacks the patched program for a distinct same-vulnerability exploit. Every successful exploit becomes a permanent repair requirement, and the final patch must block all PoVs accumulated during the patching process, with construction-time PoVs kept strictly separate from held-out evaluation oracles. Across 101 C/C++ and Java CVE subjects, this adversarial loop surfaces a distinct confirmed exploit in 41% of runs after the patch has already blocked its original construction-time PoV. Against single-pass repair from the same finding using Claude Code, P2Patch raises held-out fix-closed coverage from 78.1% to 84.7% and beyond-upstream coverage from 42.1% to 62.5%. Under the same held-out oracles, it also certifies more attack paths as blocked than recent state-of-the-art agentic repair systems on overlapping subjects. These results show that adversarial testing and independent security oracles expose repair gaps that one-shot validation misses.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- PAGENT: Program Analysis Guided LLM Agent for Proof-of-Concept GenerationProceedings of the ACM on Software Engineering · 2026
- DeepAVR: Deep Analysis via Multi-Agent Collaboration for Automated Vulnerability RepairarXiv · 2026
- Not Just Any Example: Security Requirements and Fix Patterns for Guiding LLM Vulnerability RepairarXiv · 2026
- PoCE: Automated Proof-of-Concept Synthesis using Large Language Models for Robust ValidationProceedings of the ACM on Software Engineering · 2026
- EviRepair: Evidence-Driven Agents for Reliable Vulnerability RepairarXiv · 2026
- Peer Pressure: Execution-Verified Co-Evolution of Attacker and Defender Populations for Code SecurityarXiv · 2026