P2Patch finds bypasses and strengthens vulnerability repairs
P2Patch: Exploit-Guided Vulnerability Repair · arXiv:2610.20245
In plain words
P2Patch is a system for repairing software vulnerabilities. One software agent finds an executable example of the flaw, another changes the program, and an execution referee checks whether the example still works. The first example becomes a repair requirement.
The system then searches the patched program for another route to the same flaw. In 41 of 101 C/C++ and Java repair runs, it found a confirmed bypass after the patch blocked the original example. That test shows why blocking one example alone can miss a remaining path.
The research
How can evaluators tell whether a software repair closes the reported vulnerability, rather than just blocking the example that guided it? Repair evidence often doubles as the success check, so one passed example can conceal another path for the same flaw.
P2Patch turns confirmed attacks on a patch into new repair requirements, then checks the result on independent attack tests.
Researchers compared P2Patch with single-pass repair from the same finding, without a live attack example or later bypass search. They measured, for each project, the share of conclusive held-out attack tests the patch blocked, then averaged across projects.
On tests blocked by the official fix, the averages were 0.847 for P2Patch and 0.781 for single-pass repair across 101 subjects.
On tests that also reproduce after the official fix, the averages were 0.625 and 0.421 across the 40 subjects with such suites. The orchestrator judged execution outcomes, while researchers calculated these averages.
The separate test groups show greater measured coverage on both paths the official fix closes and candidate paths it leaves open.
The attack search has a fixed budget, and the independently written test suites cover selected paths rather than the full input space. A stable run or high measured coverage therefore does not prove that a patch contains no vulnerability.
What the evidence shows
- The repair question
P2Patch is an exploit-guided vulnerability-repair system that asks whether a patch closes the reported flaw or only blocks the evidence used to build it. A static finding can point to a suspected flow without proving it is reachable or showing its security effect; a test or executable example can demonstrate one path, not every path for the same vulnerability. Reusing that evidence as the only success check can make an incomplete repair appear successful.
- Make the flaw executable
The system turns a reported vulnerability into an executable repair requirement. An exploitation agent proposes an input or test driver and command; an orchestrator accepts it only if execution reproduces the flaw.
A patching agent then changes the program until the accepted example is blocked and regression checks pass. The orchestrator decides execution outcomes, rather than letting either agent certify its own work.
- Search the patched program
Blocking that first example is only the initial gate. P2Patch sends the patched program back to the exploiter, which searches for another route to the same vulnerability.
When the orchestrator confirms a bypass by execution, the system adds it as a persistent requirement for later patches. This matters in the evaluation: a confirmed same-vulnerability bypass appeared in 41 of 101 repair runs after the original example was blocked.
- Measure beyond the example
Researchers then scored the final patches on independent tests that were withheld during repair. They measured the per-project share of conclusive tests blocked, then averaged those shares across projects.
Against single-pass repair from the same finding, P2Patch averaged 0.847 versus 0.781 on paths the official fix blocks, across 101 subjects; on paths left open by that fix, it averaged 0.625 versus 0.421 across 40 subjects.
- Test what adds coverage
A control compared repair using a first executable example alone with repair that also searched for bypasses, allowing up to four hardening rounds. The subjects and held-out tests were shared.
Coverage was higher with the hardening rounds on both test groups, supporting the interpretation that searching for and adding confirmed bypasses contributed to the measured gain in these settings. The results remain tests of selected paths, not proof of complete repair.
Deep
- Original paper authors
- Mohsen Iranmanesh, Sina Moradi Sabet, Sina Marefat, Ali Javidi Ghasr, Maxime Newman Nereyabagabo
- Submitted to arXiv
- License
- arXiv non-exclusive