VFDelta:一个通过增强代码变更学习来检测静默漏洞修复的框架
VFDelta: A Framework for Detecting Silent Vulnerability Fixes by Enhancing Code Change Learning
AI总结:
提出VFDelta框架,通过独立模型嵌入变更前后代码并执行逐元素减法以捕获细粒度变更,联合训练嵌入与分类模型,在静默漏洞修复检测中显著优于现有方法。
摘要:
开源软件(OSS)中的漏洞修复通常遵循协调漏洞披露模型并被静默修复。这种延迟可能会使OSS用户面临风险,因为恶意方可能会在修复公开之前利用该软件。因此,尽早自动识别漏洞修复非常重要。现有方法通过从提交中学习代码变更表示来对漏洞修复进行分类,通常通过拼接代码变更来实现,这无法有效突出细微差异。此外,以前的方法分别微调代码嵌入模型和分类模型,这限制了整体有效性。我们提出了VFDelta,这是一个轻量但有效的框架,它使用独立模型将变更前后的代码及其周围代码作为上下文进行嵌入。通过对这些嵌入执行逐元素减法,我们捕获了细粒度的变更。我们的架构允许嵌入模型和分类模型的联合训练,从而优化整体性能。实验表明,VFDelta的F1分数最高达到0.33,CostEffort@5达到0.63,分别比最先进的方法提高了77.4%和7.1%。消融分析证实了我们的代码变更表示在捕获微小变更方面的重要性。我们还扩展了数据集并引入了时间划分来模拟真实场景;在此设置下,VFDelta在所有指标上均显著优于基线VulFixMiner和MiDas。
英文摘要:
Vulnerability fixes in open source software (OSS) usually follow the coordinated vulnerability disclosure model and are silently fixed. This delay can expose OSS users to risks as malicious parties might exploit the software before fixes are publicly known. Therefore, it is important to identify vulnerability fixes early and automatically. Existing methods classify vulnerability fixes by learning code change representations from commits, typically by concatenating code changes, which does not effectively highlight nuanced differences. Additionally, previous approaches fine-tune code embedding models and classification models separately, which limits overall effectiveness. We propose VFDelta, a lightweight yet effective framework that embeds code before and after changes using independent models with surrounding code as context. By performing element-wise subtraction on these embeddings, we capture fine-grain changes. Our architecture allows joint training of embedding and classification models, optimizing overall performance. Experiments demonstrate that VFDelta achieves up to 0.33 F1 score and 0.63 CostEffort@5, improving over state-of-the-art methods by 77.4% and 7.1%, respectively. Ablation analysis confirms the importance of our code change representation in capturing small changes. We also expanded the dataset and introduced a temporal split to simulate real-world scenarios; VFDelta significantly outperforms baselines VulFixMiner and MiDas across all metrics in this setting.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。