ContraFix:面向漏洞修复的技能增强对比运行时分析 ContraFix: Skill-Enhanced Contrastive Runtime Analysis for Vulnerability Repair 预印本

⚠️ 本文为 预印本(arXiv 公开版本),尚未经过正式同行评审。作者自发公开,结论未经期刊审稿验证,阅读时请知悉。
发布时间:2026-05-17
👁️ 预览文献
💡 AI 中文简介
针对自动漏洞修复中缺乏修复指导的问题,本文提出ContraFix框架:从失败用例出发生成相邻的失败与非失败变体,通过对齐探针点执行并对比运行时状态,推断修复边界以指导源码级补丁生成,并利用双轨技能库复用变异与修正经验。在SEC-Bench上使用GPT-5-mini三次重复运行解决率达92.0%,平均91.8%±0.8;在PatchEval上解决225个Go、Python、JavaScript实例中的73.8%。语义审计显示58.2%的补丁语义正确,远超最强基线的31.3%。
领域软件工程 / 自动化漏洞修复
适合谁读需要一定专业背景(软件安全、程序分析与LLM智能体方向)
核心贡献1. 提出基于对比运行时分析的智能体漏洞修复框架,通过生成失败/非失败变体并对比运行时状态推断修复边界;2. 设计双轨技能库,复用变异技能构造变体、修正技能优化失败补丁,实现经验积累。
关键数据SEC-Bench上GPT-5-mini三次重复运行解决率92.0%,平均91.8%±0.8;PatchEval上解决225个Go/Python/JavaScript实例的73.8%;语义审计中58.2%补丁语义正确,最强基线仅31.3%。
推荐理由如果你关心如何让LLM智能体真正修好漏洞而不只是通过测试,这篇用对比运行时分析把模糊崩溃报告变成具体修复决策的工作值得一读。
关键词["自动漏洞修复", "多智能体框架", "对比运行时分析", "技能积累", "大语言模型"]

原文摘要

查看英文原文摘要

As software systems grow increasingly complex, automated vulnerability repair (AVR) remains difficult because the materials available to a repair system are usually failure artifacts rather than repair guidance. Traditional analysis techniques can provide suspicious locations, reduced triggers, or constraints, but they are costly to configure across repositories and seldom directly actionable for patch generation. Recent LLM-based agents can edit and validate repository-level patches, and experience-based systems can reuse prior repair traces or demonstrations, but they still need current-instance evidence that turns a broad, symptom-level failure report into a concrete repair decision. We present ContraFix, an agentic AVR framework that constructs such evidence through contrastive runtime analysis. Starting from a failing witness, ContraFix generates nearby failing and non-failing variants, executes them through aligned probe sites, and compares their runtime states to infer the repair boundary and guide source-level patching. Each candidate patch is accepted only after build and validation. ContraFix also stores validated repair episodes in a dual-track skill base, reusing mutation skills to construct useful variants and correction skills to refine failed patches. On SEC-Bench, ContraFix with GPT-5-mini achieves resolution rate of 92.0% over three repeated runs and an average resolution rate of 91.8% +/- 0.8. On PatchEval, it resolves 73.8% of 225 Go, Python, and JavaScript instances. A semantic audit of benchmark-validated SEC-Bench patches shows that 58.2% of ContraFix's patches are semantically correct, compared with 31.3% for the strongest baseline, indicating that the proposed framework improves semantic correctness beyond benchmark validation.