arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2408.08619cs.CRcs.AIcs.SE
收藏

PatUntrack: 针对无已跟踪不安全代码的问题报告自动生成补丁示例

PatUntrack: Automated Generating Patch Examples for Issue Reports without Tracked Insecure Code

Institute of Software Chinese Academy of Sciences(中国科学院软件研究所);University of Chinese Academy of Sciences(中国科学院大学);Beihang University(北京航空航天大学);The University of Queensland(昆士兰大学)

Ziyou Jiang, Lin Shi, Guowei Yang, Qing Wang

AI总结:

针对无已跟踪不安全代码的漏洞问题报告,提出PatUntrack方法,通过生成并修正漏洞触发路径描述、调用大语言模型生成补丁示例,显著提升生成效果,且经实际验证具备实用性。

摘要:

安全补丁对于提升软件社区项目的稳定性与健壮性至关重要。尽管官方期望漏洞在披露前得到修补,但漏洞修补工作十分复杂,对许多组织而言仍是一项难题。为修补漏洞,安全从业者通常会跟踪存在漏洞的问题报告(IR),并分析其相关的不安全代码以生成潜在补丁。然而,相关的不安全代码可能未被明确指明,从业者无法在代码仓库中跟踪到这些不安全代码,从而限制了他们生成补丁的能力。在这种情况下,提供不安全代码示例及对应的补丁,将有助于安全开发者更好地定位并修复不安全代码。\n本文提出PatUntrack方法,用于从无已跟踪不安全代码的问题报告中自动生成补丁示例。该方法通过自动提示大语言模型(LLM),使其适用于漏洞分析工作。它首先从存在漏洞的问题报告中生成漏洞触发路径(VTP)的完整描述;随后利用外部黄金知识修正VTP描述中的幻觉问题;最后基于修正后的VTP描述生成Top-K组不安全代码与补丁示例对。\n为评估性能,我们在5465份存在漏洞的问题报告上开展了实验。实验结果表明,PatUntrack取得了最优性能,在补丁示例生成任务的Fix@10指标上,较传统大语言模型基线平均提升了14.6%。此外,我们将PatUntrack应用于76份新披露的存在漏洞的问题报告的补丁示例生成工作。在这些问题报告作者回复的37份反馈中,有27份确认了PatUntrack生成的补丁示例具有实用性,表明他们能够借助这些示例完成漏洞修补工作。

英文摘要:

Security patches are essential for enhancing the stability and robustness of projects in the software community. While vulnerabilities are officially expected to be patched before being disclosed, patching vulnerabilities is complicated and remains a struggle for many organizations. To patch vulnerabilities, security practitioners typically track vulnerable issue reports (IRs), and analyze their relevant insecure code to generate potential patches. However, the relevant insecure code may not be explicitly specified and practitioners cannot track the insecure code in the repositories, thus limiting their ability to generate patches. In such cases, providing examples of insecure code and the corresponding patches would benefit the security developers to better locate and fix the insecure code. In this paper, we propose PatUntrack to automatically generating patch examples from IRs without tracked insecure code. It auto-prompts Large Language Models (LLMs) to make them applicable to analyze the vulnerabilities. It first generates the completed description of the Vulnerability-Triggering Path (VTP) from vulnerable IRs. Then, it corrects hallucinations in the VTP description with external golden knowledge. Finally, it generates Top-K pairs of Insecure Code and Patch Example based on the corrected VTP description. To evaluate the performance, we conducted experiments on 5,465 vulnerable IRs. The experimental results show that PatUntrack can obtain the highest performance and improve the traditional LLM baselines by +14.6% (Fix@10) on average in patch example generation. Furthermore, PatUntrack was applied to generate patch examples for 76 newly disclosed vulnerable IRs. 27 out of 37 replies from the authors of these IRs confirmed the usefulness of the patch examples generated by PatUntrack, indicating that they can benefit from these examples for patching the vulnerabilities.

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

↑