arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2212.08108cs.SEcs.CRcs.LG
收藏

受数据流分析启发的深度学习用于高效漏洞检测

Dataflow Analysis-Inspired Deep Learning for Efficient Vulnerability Detection

Iowa State University(爱荷华州立大学)

Benjamin Steenhoek, Hongyang Gao, Wei Le

AI总结:

本文提出受数据流分析启发的图学习框架 DeepDFA,通过模拟数据流计算实现高效漏洞检测,并结合 LLM 在 Big-Vul 上达到新的最优性能。

摘要:

基于深度学习的漏洞检测已展现出出色性能,并且在一些研究中优于静态分析工具。然而,性能最高的方法使用基于 token 的 transformer 模型,这类模型在捕获漏洞检测所需的代码语义方面并不是最高效的。数据流分析等经典程序分析技术能够根据多种缺陷的根本原因检测它们。本文提出将此类基于因果关系的漏洞检测算法与深度学习相结合,旨在实现更高效、更有效的漏洞检测。具体而言,我们设计了 DeepDFA,这是一个受数据流分析启发的图学习框架,以及一种使图学习能够模拟数据流计算的嵌入技术。我们表明 DeepDFA 兼具高性能与高效率。DeepDFA 优于所有非 transformer 基线。它在 9 分钟内完成训练,比性能最高的基线模型快 75 倍。当仅使用 50 多个易受攻击样本和总共数百个样本作为训练数据时,该模型保持了与使用 100% 数据集时相同的性能。DeepDFA 还能泛化到 DbgBench 中的真实世界漏洞:在各折的平均结果中,它检测到 17 个漏洞中的 8.7 个,并能够区分已修补版本和有缺陷版本,而性能最高的基线模型未检测到任何漏洞。通过将 DeepDFA 与大型语言模型结合,我们在 Big-Vul 数据集上超越了最先进的漏洞检测性能,取得了 96.46 的 F1 分数、97.82 的精确率和 95.14 的召回率。我们的复现包位于 https://doi.org/10.6084/m9.figshare.21225413。

英文摘要:

Deep learning-based vulnerability detection has shown great performance and, in some studies, outperformed static analysis tools. However, the highest-performing approaches use token-based transformer models, which are not the most efficient to capture code semantics required for vulnerability detection. Classical program analysis techniques such as dataflow analysis can detect many types of bugs based on their root causes. In this paper, we propose to combine such causal-based vulnerability detection algorithms with deep learning, aiming to achieve more efficient and effective vulnerability detection. Specifically, we designed DeepDFA, a dataflow analysis-inspired graph learning framework and an embedding technique that enables graph learning to simulate dataflow computation. We show that DeepDFA is both performant and efficient. DeepDFA outperformed all non-transformer baselines. It was trained in 9 minutes, 75x faster than the highest-performing baseline model. When using only 50+ vulnerable and several hundreds of total examples as training data, the model retained the same performance as 100% of the dataset. DeepDFA also generalized to real-world vulnerabilities in DbgBench; it detected 8.7 out of 17 vulnerabilities on average across folds and was able to distinguish between patched and buggy versions, while the highest-performing baseline models did not detect any vulnerabilities. By combining DeepDFA with a large language model, we surpassed the state-of-the-art vulnerability detection performance on the Big-Vul dataset with 96.46 F1 score, 97.82 precision, and 95.14 recall. Our replication package is located at https://doi.org/10.6084/m9.figshare.21225413 .

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

↑