arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2607.00820cs.SE
收藏

知识增强的智能体漏洞修复

Knowledge-Enhanced Agentic Vulnerability Repair

Nanjing University of Posts and Telecommunications(南京邮电大学);National Interdisciplinary Research Center of Engineering Physics(工程物理国家 interdisciplinary 研究中心);Alibaba Qwen(阿里巴巴通义千问);Beijing Jiaotong University(北京交通大学);Zhejiang University(浙江大学);Yangzhou University(扬州大学);Nanjing University(南京大学);Singapore Management University(新加坡管理大学)

Sicong Cao, Hao Ma, Le Yu, Kangyi Ding, Xiaolei Liu, Terry Yue Zhuo, Bo Wang, Xingwei Lin, Xiaobing Sun, Linzhang Wang, David Lo

AI总结:

提出KeaRepair,一种基于智能体的自动化漏洞修复方法,通过提取历史漏洞知识并利用工具增强的智能体进行诊断,生成并迭代优化补丁,在55个C/C++漏洞上修复率达83.64%。

摘要:

前沿基础模型改变了漏洞发现的格局,但更大的挑战在于修复方面如何跟上。尽管自动化漏洞修复(AVR)近期取得了进展,但当前方法难以可靠地识别漏洞根本原因,且未能充分利用先验修复知识指导补丁生成过程,从而削弱了其实际有效性。为弥补这一差距,我们提出KeaRepair,一种新颖的智能体AVR方法,将补丁生成建立在已验证的程序事实和高层次漏洞知识之上。具体而言,KeaRepair首先从历史漏洞-补丁对中从双互补视角提取多维漏洞知识,并构建专用检索知识库。然后,它采用一个工具增强的智能体,执行ReAct风格的推理以收集已验证的程序事实用于漏洞诊断。最后,基于诊断结果,KeaRepair进行知识级检索增强的补丁生成,并通过包含编译、PoC重放和测试套件执行的闭环验证过程迭代优化补丁。实验结果表明,KeaRepair在55个可复现的C/C++漏洞上显著优于现有AVR方法。当与Gemini-3.1-Pro配合使用时,KeaRepair成功修复46个漏洞,修复率达83.64%。此外,KeaRepair修复了所有基线方法均无法处理的六个独特漏洞,并进一步展示了强大的跨语言泛化能力。

英文摘要:

Frontier foundation models have changed the math on vulnerability discovery, but the bigger challenge is how the remediation side keeps up. Despite recent progresses in Automated Vulnerability Repair (AVR), current solutions struggle to reliably identify the root causes of vulnerabilities, and insufficiently utilize the prior fix knowledge to guide the patch generation process, thus undermining their effectiveness in practice. To address this gap, we propose KeaRepair, a novel agentic AVR approach that grounds patch generation in verified program facts and high-level vulnerability knowledge. Specifically, KeaRepair first extracts multi-dimensional vulnerability knowledge from historical vulnerability-patch pairs from dual complementary views, and constructs dedicated retrieval knowledge bases. It then employs a tool-augmented agent that performs ReAct-style reasoning to collect verified program facts for vulnerability diagnosis. Finally, based on the diagnostic results, KeaRepair performs knowledge-level retrieval-augmented patch generation and iteratively refines patches through a closed-loop validation process involving compilation, PoC replay, and test-suite execution. Experimental results show that KeaRepair significantly outperforms existing AVR approaches on 55 reproducible C/C++ vulnerabilities. When paired with Gemini-3.1-Pro, KeaRepair successfully repairs 46 vulnerabilities, achieving a repair rate of 83.64%. Moreover, KeaRepair fixes six unique vulnerabilities that none of the baselines can address, and further demonstrates strong cross-language generalizability.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑