VGX:用于促进基于学习的软件漏洞分析的大规模样本生成
VGX: Large-Scale Sample Generation for Boosting Learning-Based Software Vulnerability Analyses
AI总结:
本文提出 VGX 技术,通过定制 Transformer 识别漏洞注入上下文并结合历史修复模式,实现大规模高质量漏洞样本生成,显著提升了漏洞检测、定位和修复任务的性能并发现新 CVE。
摘要:
伴随着基于学习的防御性软件漏洞分析取得成功,出现了缺乏大规模且高质量的带标签漏洞程序样本集的问题,这阻碍了这些防御技术的进一步发展。现有的自动化样本生成方法已展现出潜力,但由于生成的样本中存在高噪声,仍未能达到实际期望。本文提出了 VGX,这是一种旨在大规模生成高质量漏洞数据集的新技术。给定一个普通程序,VGX 识别出可以注入漏洞的代码上下文,使用一个定制的 Transformer 实现,该 Transformer 具有基于值流的新位置编码,并针对新目标进行了预训练,特别用于学习代码结构和上下文。然后,VGX 利用从历史修复和关于真实世界漏洞的人类知识中获取的此类编辑模式,在识别出的上下文中实现漏洞注入代码编辑。与四个最先进的(SOTA)基线(基于模式、Transformer、GNN 和模式+Transformer)相比,VGX 实现了 99.09-890.06% 更高的 F1 和 22.45%-328.47% 更高的标签准确率。在实际样本生产中,VGX 生成了 150,392 个漏洞样本,我们从中随机选择 10% 来评估这些样本对漏洞检测、定位和修复的帮助程度。我们的结果表明,通过将这些样本添加到原始训练数据中,这三个应用任务的 SOTA 技术分别实现了 19.15-330.80% 更高的 F1、12.86-19.31% 更高的 top-10 准确率和 85.02-99.30% 更高的 top-50 准确率。这些样本还帮助 SOTA 漏洞检测器在关键系统(例如 Linux 内核)中发现了 13 个原始模型会遗漏的真实世界漏洞(CVE)。
英文摘要:
Accompanying the successes of learning-based defensive software vulnerability analyses is the lack of large and quality sets of labeled vulnerable program samples, which impedes further advancement of those defenses. Existing automated sample generation approaches have shown potentials yet still fall short of practical expectations due to the high noise in the generated samples. This paper proposes VGX, a new technique aimed for large-scale generation of high-quality vulnerability datasets. Given a normal program, VGX identifies the code contexts in which vulnerabilities can be injected, using a customized Transformer featured with a new value-flowbased position encoding and pre-trained against new objectives particularly for learning code structure and context. Then, VGX materializes vulnerability-injection code editing in the identified contexts using patterns of such edits obtained from both historical fixes and human knowledge about real-world vulnerabilities. Compared to four state-of-the-art (SOTA) baselines (pattern-, Transformer-, GNN-, and pattern+Transformer-based), VGX achieved 99.09-890.06% higher F1 and 22.45%-328.47% higher label accuracy. For in-the-wild sample production, VGX generated 150,392 vulnerable samples, from which we randomly chose 10% to assess how much these samples help vulnerability detection, localization, and repair. Our results show SOTA techniques for these three application tasks achieved 19.15-330.80% higher F1, 12.86-19.31% higher top-10 accuracy, and 85.02-99.30% higher top-50 accuracy, respectively, by adding those samples to their original training data. These samples also helped a SOTA vulnerability detector discover 13 more real-world vulnerabilities (CVEs) in critical systems (e.g., Linux kernel) that would be missed by the original model.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。