PatchBench: University of Maryland team releases C/C++ vulnerability repair evaluation benchmarkPatchBench: Evaluating AI Agents for Vulnerability Patching
Quick read
Evaluation and benchmarksBased on the paper PDF (generated by Gemini); refer to the original
The paper proposes PATCHBENCH to evaluate 11 agents, finding an average original PoC pass rate of 83.1%, and after security and semantic dual validation the average solve rate is only 45.3%.
- Existing vulnerability repair evaluations rely on a single PoC crash test, which has two fatal flaws: large models may reproduce historical patches through memorization, and agents often add local checks on crash stack functions to suppress crashes rather than locating and fixing the root cause.
- Proposes the PATCHBENCH benchmark, selecting C/C++ vulnerabilities where the developer patch lies outside the crash stack, and combining version porting and code mutation to suppress memorization; also uses multi-PoC safety validation and benign input semantic validation (including output state and unit tests) for evaluation.
- In evaluations of 11 agents, the average original PoC pass rate is 83.1%, and after security and semantic dual validation the solve rate drops to 45.3% (per Table 2); Codex+GPT-5.6 Sol has the highest solve rate (59.2%), and 67 tasks are unsolved by all agents.
- During deployment, there is no reference repository for semantic comparison; fuzzing cannot guarantee coverage of all paths, so a few patches that pass validation still do not fully fix the root cause; the benchmark is a static dataset, and there remains a risk of future model training data contamination.
- Evaluated models
- Codex + GPT-5.6 SolOpenHands + GPT-5.6 SolClaude Code + Claude Opus 4.8AtlantisOpenHands + Claude Opus 4.8OpenHands + Gemini 3.5 FlashButtercupOpenHands + GPT-5OpenHands + Claude Sonnet 4.5OpenHands + Gemini 3.1 ProRoboDuckGPT-5.6 SolClaude Opus 4.8Gemini 3.5 Flash
- Benchmarks
- PATCHBENCHSEC-BENCHARVO
- Metrics
- Solved ratePoC pass rateSecurity pass rateSemantic pass rateDiffBLEU
Researchers at the University of Maryland propose PatchBench, an evaluation benchmark for repository-level vulnerability repair in C/C++, containing 213 repair tasks across 32 real projects and 16 CWE categories. The team first used their newly proposed DiffBLEU patch similarity metric and found that on SEC-bench, an average of 25% of Agent patches were highly similar to developer historical patches, notably higher than the 11% for pure LLM local-context repair, indicating that patch memorization threatens evaluation validity. To reduce memorization and superficial repair, PatchBench only selects vulnerabilities whose real fix location is not on the crash call stack, and migrates historical vulnerabilities to new-version repositories through vulnerability transplantation and code mutation, then manually curates reference patches.
Why it was selectedThe paper re-evaluates 11 repair agents using patch similarity and multi-PoC plus semantic validation, pointing out that relying solely on the original PoC inflates the solve rate by approximately 1.83 times.
Paper analysis
What problem does this paper attempt to solve?
Existing vulnerability repair evaluations suffer from two fatal validity flaws—patch memorization and single-PoC surface suppression—causing repair capabilities to be falsely exaggerated.
There are two fatal validity flaws in automated vulnerability repair evaluation: patch memorization and single-PoC surface suppression.
- Research background and problem importance: Software vulnerability repair is costly and time-consuming. Although AI agents show potential in automated vulnerability repair, the authors point out that rigorous evaluation of AI-assisted repair capabilities still faces challenges.
- Shortcomings of existing evaluation methods: Existing evaluations typically only check whether the program no longer crashes on a single PoC input, leading to two types of validity risks: the model may merely reproduce known patches memorized from the training set, or it may only generate surface patches near the crash stack that suppress errors without truly locating and fixing the root cause.
- Core observation of the paper: Experiments on the real vulnerability benchmark SEC-BENCH show that Codex + GPT-5.6 Sol can pass 97.3% of tasks, but the authors find that on average 25% of its patches are highly similar to historical developer patches; even when the developer patch is not on the crash call stack, the agent still modifies crash stack functions in 64% of patches.
- Proposed solution: The authors propose the benchmark PATCHBENCH containing 213 C/C++ tasks, which eliminates memorization shortcuts by filtering off-stack vulnerabilities, cross-version porting, and code mutation, and establishes an evaluation pipeline with multi-PoC safety validation and benign input semantic validation.
What related research exists?
Related research focuses on vulnerability repair benchmarks, agent-based repair systems, and patch validation methods, but generally lacks anti-memorization design and fine-grained semantic checks.
In related work, the paper mainly reviews research in the following three areas:
Vulnerability Patching Benchmarks
- Defects4J (Just et al., 2014) and GitBug-Java (Silva et al., 2024): used for general program automatic repair, but subsequent studies point out data contamination and patch memorization phenomena.
- EXTRACTFIX (Gao et al., 2021), SAN2VULN (Kim et al., 2025), PATCHAGENT (Yu et al., 2025), and SEC-BENCH (Lee et al., 2026): provide repository-level executable environments, but the authors note they rely only on a single PoC to validate patches and none provide anti-memorization mechanisms (Table 1).
- AUTOPATCHBENCH (Meta, 2025) and AIxCC AFC (Zhang et al., 2026): AUTOPATCHBENCH uses single-run undirected fuzzing to distill inputs and performs function-level state differential testing; the authors believe it is difficult to generate new PoCs targeting the specific vulnerability and prone to falsely rejecting equivalent-state patches; AIxCC relies on experts manually writing 40 synthetic C vulnerabilities, and the authors note manual writing is costly and difficult to scale.
LLM-based Vulnerability Patching Agents
- General software engineering agents: SWE-Search (Antoniades et al., 2025), SWE-agent (Yang et al., 2024), and OpenHands (Wang et al., 2025), etc., allow LLMs to autonomously explore code repositories, edit files, and run terminal commands in structured environments.
- Dedicated security vulnerability repair agents: APPATCH (Nong et al., 2025) and AIxCC finalist systems Atlantis (Team Atlanta, 2025), Buttercup (Trail of Bits, 2025), and RoboDuck (Team Theori, 2025), combining LLMs with system security tools or adopting multi-agent collaborative architectures.
Patch Validation Methods
- Program analysis and differential validation: Gallagher et al. (2014), Kim et al. (2023) use static or dynamic analysis to validate patches; SPIDER (Machiry et al., 2020) and VeriBin (Wu et al., 2025) propose security patch conditions, which the authors note are too strict for vulnerability patches.
- LLM patch evaluation practices: prior studies combine unit tests, LLM review (Team Atlanta, 2025), post-repair fuzzing, and manual audit, but several recent comprehensive reviews (Hu et al., 2025; Li et al., 2025; Zhang et al., 2026) all point out that existing security patch validation remains insufficient.
Baseline Methods and Benchmarks
- The paper compares 3 commercial and open-source general agent frameworks (Codex, Claude Code, OpenHands) and 3 AIxCC finalist systems (Atlantis, Buttercup, RoboDuck); the comparison benchmark is SEC-BENCH, with the data source based on ARVO.
Positioning of the Paper Relative to Related Work
- The authors state that, compared with previous benchmarks, PATCHBENCH simultaneously achieves effective suppression of patch memorization effects (through version porting and code mutation) and establishes a comprehensive validation pipeline covering crash-set elimination and benign-input program-level output state consistency.
How does the paper address this problem?
The benchmark is constructed through off-stack vulnerability filtering, cross-version porting, and code mutation, combined with directed fuzzing and benign-input state comparison for comprehensive validation.
Overall, the paper proposes the context-aware patch similarity metric DiffBLEU, constructs the benchmark PATCHBENCH to mitigate memorization effects, and designs a two-stage patch validation pipeline covering security and semantic dimensions.
Patch Memorization Measurement and DiffBLEU
- Metric design: DiffBLEU extends CodeBLEU, combining a difference-aware tokenizer and program slicing to compute the similarity between candidate patches and developer patches: DiffBLEU = α BLEU(Δr, Δc) + β BLEUw(Δr, Δc) + γ Matchast(Cr, Cc) + δ Matchdf(Cr, Cc) The first two terms measure lexical surface similarity of patch block differences, and the last two terms measure structural similarity of patch code context on control-flow AST and data-flow slices.
- Tokenization and slicing details: The tokenizer maps added and deleted lines to separate spaces, anonymizes literals, and removes comments; AST matching targets control-flow slices containing the patch, and data-flow matching targets dependency slices of patched variables. Parameters are set to alpha=0.3, beta=0.3, gamma=0.2, delta=0.2, and the memorization threshold is set to 0.75.
Benchmark Construction Pipeline
The benchmark is built from the ARVO dataset, containing 213 tasks (involving 32 projects and 16 CWEs), divided into 7 steps:
- Locate developer patch points: Map the code entities modified by the developer patch to a specific set of functions.
- Measure distance from crash stack: Collect the call stack when the PoC execution first reaches the patch point and the call stack at the crash, and compute the Jaccard similarity of their function sets (overlap score rho).
- Filter off-stack tasks: Keep only vulnerabilities whose patch points are not on the crash stack, and further require overlap rho <= 0.5, ensuring the crash is only a downstream symptom.
- Port vulnerabilities across versions: Reverse the developer patch into a bug-inducing diff, and use binary search to locate the latest Git commit where the diff can be successfully applied and the crash reproduced.
- Mutate code at patch locations: First apply NATGEN's 5 semantics-preserving transformations to each patch block (variable renaming, loop transformation, statement block swapping, operand swapping, insertion of obfuscation code), then use CODEMORPH to randomly apply one context refactoring (such as extracting a condition into a new function), so the original developer patch cannot be directly applied.
- Manually curate reference patches: Manually review mutated patches and vulnerability root causes, remove modifications unrelated to the vulnerability, and ensure reference patches precisely eliminate the root cause.
- Filter for validation support: Keep tasks with a valid fuzzing engine that can pass at least one unit test on both the benchmark and the repaired repository.
Dual Patch Validation Mechanism
Patches generated by agents are required to satisfy two validation conditions simultaneously:
- Input space generation: Combine PoC-directed fuzzing (CONCFUZZ, run for 10 minutes, median 33 new PoCs generated) with undirected regular fuzzing (run for 10 minutes) to construct a crash corpus (triggering crashes only in the task repository) and a benign corpus (no crashes in either repository).
- Security validation: Run all inputs in the crash corpus and require that the agent-patched repository triggers no Sanitizer errors, screening out surface fixes that only intercept the single original PoC.
- Semantic correctness validation: Includes three checks: Sanitizer regression check (benign inputs trigger no new Sanitizer errors), program-level output state check (outputs on benign inputs exactly match the reference repository, with 3 runs to remove unstable inputs), and project unit test check (passing all unit tests that the reference repository passes).
What experiments did the paper conduct?
Evaluating 11 agents finds an original PoC pass rate of 83.1%, and after dual validation the solve rate is only 45.3%; increasing the budget yields no significant improvement in the solve rate.
Experimental Setup
- Models and agents under test: General agents include Codex + GPT-5.6 Sol, Claude Code + Claude Opus 4.8, and OpenHands with 6 models (GPT-5.6 Sol, GPT-5, Claude Opus 4.8, Claude Sonnet 4.5, Gemini 3.5 Flash, Gemini 3.1 Pro); AIxCC finalist systems include Atlantis (running GPT-5.6 Sol and Claude Opus 4.8), Buttercup (GPT-5.6 Sol), and RoboDuck (GPT-5.6 Sol).
- Test benchmark and scale: PATCHBENCH benchmark (213 C/C++ tasks covering 32 projects and 16 CWEs) and SEC-BENCH (300 tasks) used for memorization comparison.
- Baseline and environment: Repository, build toolchain, PoC, and Sanitizer reports are provided in Docker containers; all external network retrieval is disabled. All models are configured with medium reasoning effort.
- Metric definitions: PoC Pass (proportion eliminating crashes on the original PoC), Security Pass (proportion passing the expanded crash corpus), Semantic Pass (proportion passing three benign-input checks), Solved (proportion passing both security and semantic validation), Budget Exhausted (proportion exhausting the budget).
- Review method and judgment criteria: Automated execution of fuzzing-generated crashes and benign inputs, comparing Sanitizer errors, program-level output states, and unit test results; no LLM scoring is used.
- Budget and repetition: General agents have a per-task budget cap of $5 (Atlantis has 4 nodes at $5 each, totaling $20); output state checks run 3 times to remove unstable inputs; total inference cost is approximately $6,500.
Main Results
Swipe horizontally to read the table
Agent configuration Solved (%) PoC Pass (%) Security Pass (%) Semantic Pass (%) Budget Exhausted (%) Codex + GPT-5.6 Sol 59.2 97.2 81.7 70.9 6.6 OpenHands + GPT-5.6 Sol 58.2 98.1 81.2 70.0 1.4 Claude Code + Claude Opus 4.8 56.8 97.7 75.6 68.1 8.9 Atlantis 48.4 92.0 70.9 66.7 11.7 OpenHands + Gemini 3.5 Flash 44.1 77.9 61.0 64.8 5.6 Buttercup 42.7 72.3 58.2 64.8 7.0 RoboDuck 29.6 46.5 39.9 51.6 2.3 Note: Per Table 2, the table limits rows and omits OpenHands + Claude Opus 4.8 (47.9%), OpenHands + GPT-5 (42.3%), OpenHands + Claude Sonnet 4.5 (38.0%), OpenHands + Gemini 3.1 Pro (31.5%).
- PoC pass rate is inflated and distorts capability rankings: The average original PoC pass rate across all agents is 83.1%, while the final solve rate is only 45.3% (1.83x inflation); for example, OpenHands + GPT-5 ranks 4th in PoC pass rate (96.2%) but only 8th in solve rate (42.3%), below Gemini 3.5 Flash (44.1%), whose PoC pass rate is only 77.9%.
- Semantic validation is the main failure bottleneck: The average semantic validation pass rate across all agents is only 63.4%, with failures concentrated in output states (average pass rate 75.5%) and unit tests (average pass rate 79.9%), while the Sanitizer regression average pass rate is 95.7% (Table 4).
- Dedicated AIxCC systems lag behind general agents on the same base model: Buttercup (42.7%) and RoboDuck (29.6%), based on GPT-5.6 Sol, lag behind Codex (59.2%) and OpenHands (58.2%) using the same model; the authors attribute this to overly constrained workflow restrictions (such as limiting single-function modifications or fixed templates) and framework failures (such as RoboDuck exiting directly on patch failure and Buttercup's context retrieval failure rate of 23.5%).
Budget Expansion and Solve Ceiling Analysis
- Test setup: The per-task budget of Codex + GPT-5.6 Sol, Claude Code + Claude Opus 4.8, and OpenHands + Gemini 3.5 Flash is gradually increased from $5 to $25 (Figure 6).
- Test results: Codex's solve rate rises from 59.2% at $5 to 61.5% at $15 and then completely plateaus (still 61.5% at $20 and $25); Claude Code rises from 56.8% to 58.2% and plateaus; OpenHands rises from 44.1% to 46.4% and plateaus. At $25, the proportion of tasks interrupted due to budget exhaustion is no more than 1.4%.
- Authors' interpretation: The authors believe that increasing the budget yields marginal gains and quickly reaches a plateau, indicating that budget is not the main bottleneck for current agents; 67 of the 213 tasks are unsolvable by all 11 agents.
Failure Mode Categorization and Analysis
The authors manually categorized patches that passed the original PoC but failed comprehensive validation, summarizing 4 failure modes:
- Mode 1: Using incomplete local checks to mask symptoms: The most common failure mode, accounting for 41 of 81 such failed patches produced by Codex + GPT-5.6 Sol (Claude Code 47/87, OpenHands + Gemini 3.5 Flash 39/72). Agents only add local boundary checks or early returns at the Sanitizer error location, failing to defend against other mutated inputs with the same root cause.
- Mode 2: Failing to locate the root cause of the functional anomaly: The patch passes security checks but breaks benign-input behavior or retains incorrect logic, causing output state or unit test failures (e.g., rewriting a loop so grid data and counts no longer match).
- Mode 3: Directly deleting the crash-triggering operation or entire functionality: Agents prevent crashes by deleting crashing code or functional modules (e.g., Buttercup deleting an entire TLS metadata extraction code block).
- Mode 4: Adding overly broad checks that break legitimate functionality: The new condition not only blocks the PoC but also rejects benign legitimate inputs.
Other Ablations and Analyses
- Output state check contribution (Table 3): Removing the output state check raises the average solve rate across all agents by 8.1 percentage points; OpenHands + GPT-5 rises the most (11.3 percentage points), and RoboDuck rises the least (4.7 percentage points).
- Manual review of patches intercepted by output state checks: Of the 18 patches from Codex that failed only the output state check, manual re-review confirmed all as invalid patches (15 belonging to Mode 2, 3 belonging to Mode 4), with none caused by detection tool defects.
- PATCHBENCH anti-memorization effect (Figure 9): At a DiffBLEU threshold of 0.75, the proportions of patches judged as memorized for Codex, Claude Code, and OpenHands are 0.0%, 1.4%, and 0.9%, respectively, with about 40% of patches scoring 0; on SEC-BENCH, the corresponding proportions for these three model series are 22.0%, 27.7%, and 24.3%.
What are some points that can be further explored?
The authors point out limitations such as the lack of a reference repository during deployment, incomplete fuzzing path coverage, and static contamination of the benchmark.
Limitations and future directions noted by the authors
- Dependence on reference patch repository during deployment: In Section 6, the authors note that in real deployment scenarios for agents, there is no reference patch repository for semantic validation; although one can compare output states between vulnerable and patched repositories, this weak reference cannot account for functional changes that correct patches intentionally fix.
- Validation blind spots due to insufficient input corpus coverage: In Section 6, the authors note that manual review found that 6.8% of Atlantis patches and 7.1% of Codex patches that passed validation still did not fully fix the root cause, because fuzzing cannot guarantee coverage of all relevant paths; future directions propose using symbolic execution or concolic execution to generate inputs that can simultaneously reach both the patch path and the developer path to reduce false positives.
- Static benchmark has future data contamination risk: In Section 6, the authors note that PATCHBENCH is a static benchmark, and future models trained on the benchmark still have contamination risk; future directions propose that researchers can use the paper's vulnerability porting and mutation methods to dynamically construct evaluations on newly disclosed real vulnerabilities for continuous assessment.
- Inability to directly determine specific training data of private models: In Section 6, the authors note that since actual training data of proprietary models is inaccessible, the purpose of memorization measurement research is not to directly point out which training data was memorized, but to reveal the phenomenon that models can generate highly similar patches without reasoning about the root cause.
Experimental coverage
- Programming languages and vulnerability types: All tested tasks target C/C++ languages, covering 16 CWE types and 32 open-source projects, totaling 213 tasks.
- Systems under test: The evaluation covers 3 commercial and open-source general frameworks (Codex, Claude Code, OpenHands) and 3 AIxCC finalist systems (Atlantis, Buttercup, RoboDuck), totaling 11 agent configurations.
- Task filtering constraints: Only off-stack vulnerability tasks where the developer patch location is outside the Sanitizer crash call stack and the call stack overlap Jaccard similarity rho <= 0.5 are included.
- Testing overhead and compute budget: The main experiment has a budget cap of $5 per task (Atlantis 4 nodes at $5 each, totaling $20), extended experiments test up to $25; the total inference cost for the full benchmark is approximately $6500.
- Information not reported in the paper: The paper does not report the impact of different sampling temperatures on patch diversity, nor does it report performance comparisons of models under non-medium reasoning effort (e.g., low or high reasoning effort).
Summarize the main content of the paper
The paper reveals memorization and surface-protection problems in vulnerability repair evaluation, proposes an off-stack mutation benchmark with dual validation, and measures that agents' actual solve rate is only about half.
- Positioning and core problem: This paper targets two validity flaws in AI vulnerability repair agent evaluation—"patch memorization" and "surface suppression"—and proposes the PATCHBENCH evaluation benchmark, which includes code mutation and cross-version porting, along with a dual validation pipeline.
- Problem to solve: Existing evaluations deem a repair successful merely because a single PoC no longer crashes, causing models to tend to directly reproduce developer patches memorized from the training set, or to add local checks near the crash stack to suppress the error, producing a pass rate inflation of up to 1.83x and distorting judgments of different agents' capabilities.
- Method highlights: DiffBLEU, a patch similarity metric, is designed via program slicing and differential tokenization; the benchmark selects vulnerabilities whose patch points lie outside the crash call stack (call stack overlap Jaccard similarity no more than 0.5), breaks literal memorization by backporting historical vulnerabilities to new versions and applying NATGEN and CODE-MORPH code semantic mutations; establishes security validation combining PoC-directed fuzzing expansion, and semantic validation including program-level output state consistency comparison on benign inputs.
- Core experimental results:
- On SEC-BENCH, patches generated by general agents are on average 25% highly similar to historical developer patches (DiffBLEU > 0.75), while on PATCHBENCH this proportion drops to 0% to 1.4%.
- In evaluations of 11 top agents on PATCHBENCH, the average original PoC pass rate is 83.1%, but after security and semantic dual validation the average solve rate is only 45.3% (the highest solve rate is Codex + GPT-5.6 Sol at 59.2%).
- The average benign-input semantic validation pass rate across all agents is only 63.4%, of which the output state check average pass rate is only 75.5%, the main failure bottleneck.
- Raising the budget from a $5 cap to $25 improves the solve rate by only 1.4 to 2.3 percentage points and quickly plateaus; across the full benchmark, all agents fail to repair 67 tasks.
- Authors' conclusions and implications: The authors note that single-PoC crash suppression not only distorts evaluation but also masks the fact that agents lack program-level global reasoning; future automated vulnerability repair systems must abandon shortcut strategies based on local patching around the crash stack and strengthen true root-cause localization and cross-input functional equivalence guarantees.