一句话:提出两阶段方法 Taper,用 CVE 描述缩小提交范围并挖掘时间邻近补丁作难负样本微调语言模型,实现高效鲁棒的安全补丁定位。
安全补丁定位将开源软件中已披露的漏洞与对应补丁关联起来,是及时缓解 OSS 漏洞风险的重要技术。现有工作多聚焦于估计单个补丁与 CVE 的相关性,难以满足工业场景的两个关键需求:在海量提交中高效检索,以及对“相关但不修复”的混淆补丁保持鲁棒。本文报告了 Taper 的开发与部署经验:它是一种两阶段方法,通过挖掘提交与 CVE 之间的时间关系实现高效且鲁棒的补丁定位。第一阶段从 CVE 描述中抽取修复版本与受影响版本信息,缩小提交检查范围以提升效率;第二阶段收集与真实安全补丁提交在时间上邻近的补丁作为难负样本,微调语言模型,从而避免将混淆补丁误判为安全补丁,提高定位精度与鲁棒性。作者在来自 978 个 OSS 项目、编程语言分布均衡且贴近工业环境的 2128 个 CVE 上评估,Taper 显著优于最先进的 PatchFinder,MRR 与 Recall@1 绝对提升分别为 0.422 与 0.541,并自 2024 年 10 月起在华为云部署,800 小时运行中定位超过 52140 个安全补丁。
Security-patch localization, which links disclosed vulnerabilities in open-source software (OSS) to corresponding patches, has become a practical technique to mitigate the risk of OSS vulnerabilities in a timely manner. While existing approaches extensively focus on estimating the correlation between individual patches and Common Vulnerabilities and Exposures (CVEs), they often fail to address two major industrial requirements that make a tool of security-patch localization desirable in industrial settings: (1) efficiency when inspecting an enormous number of commits per vulnerability and (2) robustness to handle confusing patches (related but non-fixing commits). Toward addressing the preceding industrial requirements, in this paper, we report our experiences of developing and deploying Taper, a two-stage approach for efficiently and robustly locating security patches via mining the temporal relations among commits and CVEs. In the first stage, Taper extracts the information of the fixed version and the affected version from CVE descriptions to narrow down the inspection scope of commits, thus significantly improving the efficiency. In the second stage, Taper collects temporally co-located patches around the genuine security-patch commit as hard negative examples for security-patch localization. By fine-tuning a language model with these hard negative samples, Taper avoids recognizing confusing patches as security patches, thus improving patch-localization precision and robustness. We evaluate Taper against 2,128 CVEs from 978 OSS projects, which have a balanced distribution of programming languages and are consistent with industrial settings. Evaluation results show that Taper substantially outperforms a state-of-the-art approach named PatchFinder, improving the absolute MRR and Recall@1 by 0.422 and 0.541, respectively. Taper has been deployed at Huawei Cloud since October 2024. During 800 hours of operation, Taper helps locate over 52,140 security patches, providing daily service of security-patch localization for the Huawei company and Huawei Cloud users. We summarize three major lessons learned from developing and deploying Taper.
@inproceedings{paperbot8982,
title = {Efficient and Robust Security-Patch Localization for Disclosed OSS Vulnerabilities with Fine-Tuned LLMs in an Industrial Setting},
author = {Dezhi Ran and Lin Li and Liuchuan Zhu and Yuan Cao and Landelong Zhao and Xin Tan and Guangtai Liang and Qianxiang Wang and Tao Xie},
booktitle = {FSE},
year = {2025},
doi = {10.1145/3696630.3728551}
}