Skip to main content
QUICK REVIEW

[论文解读] VulLibGen: Generating Names of Vulnerability-Affected Packages via a Large Language Model

Tianyu Chen, Lin Li|arXiv (Cornell University)|Aug 9, 2023
Web Application Security VulnerabilitiesComputer Science被引用 3
一句话总结

VulLibGen 是首个仅依赖漏洞描述自动生成准确受影响第三方库列表的生成式方法,通过微调大型语言模型(LLMs)实现。利用 LLM 对库功能的先验知识,并结合输入增强与后处理技术,其 F1 得分为 0.626,平均优于当前最先进方法 10%,零样本库检测性能提升 39%。

ABSTRACT

Security practitioners maintain vulnerability reports (e.g., GitHub Advisory) to help developers mitigate security risks. An important task for these databases is automatically extracting structured information mentioned in the report, e.g., the affected software packages, to accelerate the defense of the vulnerability ecosystem. However, it is challenging for existing work on affected package identification to achieve a high accuracy. One reason is that all existing work focuses on relatively smaller models, thus they cannot harness the knowledge and semantic capabilities of large language models. To address this limitation, we propose VulLibGen, the first method to use LLM for affected package identification. In contrast to existing work, VulLibGen proposes the novel idea to directly generate the affected package. To improve the accuracy, VulLibGen employs supervised fine-tuning (SFT), retrieval augmented generation (RAG) and a local search algorithm. The local search algorithm is a novel postprocessing algorithm we introduce for reducing the hallucination of the generated packages. Our evaluation results show that VulLibGen has an average accuracy of 0.806 for identifying vulnerable packages in the four most popular ecosystems in GitHub Advisory (Java, JS, Python, Go) while the best average accuracy in previous work is 0.721. Additionally, VulLibGen has high value to security practice: we submitted 60 pairs to GitHub Advisory (covers four ecosystems). 34 of them have been accepted and merged and 20 are pending approval. Our code and dataset can be found in the attachments.

研究动机与目标

  • 解决 53.3% 的 NVD 漏洞报告中未提及受影响库,且 59.82% 的包含列表不完整或不准确的严峻问题。
  • 克服现有命名实体识别(NER)、XML 和实体链接方法在扩展至大型库仓库时面临的误报、漏报及高计算成本的局限性。
  • 利用 LLM 对库语义与结构的先验知识,实现对受影响库(尤其是训练中未见的零样本库)的准确识别。
  • 通过生成式 LLM 直接从漏洞描述预测库名称,减少对昂贵库匹配或 TF-IDF 过滤的依赖。
  • 通过后处理技术纠正幻觉现象,提升输入增强以增强零样本检测能力,从而提高库漏洞识别的可靠性与精确度。

提出的方法

  • 在 Maven 语料库上以无监督方式微调预训练的 LLaMA 模型,使其能够将库描述映射到对应库名称,激活对库身份的先验知识。
  • 在标注的漏洞数据集上进行有监督微调,输入为漏洞描述,输出为真实受影响库的列表,使模型能够生成准确的名称列表。
  • 通过重述或改写漏洞描述实施输入增强,使模型接触多样化的表达方式,提升对训练数据中未出现的零样本库的泛化能力。
  • 引入后处理模块,利用精心整理的库名称字典及语法/语义验证,过滤并校正 LLM 生成的库列表,以减少幻觉现象。
  • 利用 LLM 的上下文推理能力,将漏洞特征(如内存损坏、身份认证绕过)与库功能及已知漏洞进行关联。
  • 采用两阶段训练流程:首先在库描述上进行无监督预训练以学习库身份,然后在漏洞描述到库列表对上进行有监督微调,以学习漏洞特定的生成能力。

实验结果

研究问题

  • RQ1大型语言模型能否仅从漏洞描述中生成准确、完整且正确的受影响第三方库列表,而无需依赖库名称字典或外部匹配?
  • RQ2所提出的输入增强技术在提升对训练中未见的零样本漏洞库的识别能力方面效果如何?
  • RQ3后处理技术在多大程度上减少了 LLM 生成库列表中的幻觉现象并提升了精确度?
  • RQ4在真实世界数据集上,VulLibGen 在识别受影响库方面的性能与最先进方法(如 LightXML、Chronos、VulLibMiner)相比如何?
  • RQ5具备库先验知识的 LLM 是否能在漏洞库识别任务中超越传统 NLP 和深度学习模型?

主要发现

  • VulLibGen 在识别受影响库方面取得平均 F1 得分为 0.626,优于当前最先进方法(LightXML、Chronos、VulLibMiner)的平均值 0.561。
  • 后处理技术使 F1@1 平均提升 9.3%,显著减少了由 LLM 幻觉导致的误报。
  • 输入增强技术在识别零样本漏洞库时,使 F1@1 性能平均提升 39%,展现出对未见库的强大泛化能力。
  • VulLibGen 有效识别受影响库,无需依赖昂贵的 TF-IDF 过滤或库名称字典,相比实体链接方法显著降低了计算开销。
  • 该模型在多种漏洞类型下表现稳健,包括涉及复杂库交互或细微功能差异的漏洞。
  • 两阶段微调方法——先在库描述上进行无监督预训练,再在漏洞对上进行有监督微调——使 LLM 有效学习到库身份与漏洞特异性关联。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。