学习量化漏洞模式并匹配以定位语句级漏洞
Learning to Quantize Vulnerability Patterns and Match to Locate Statement-Level Vulnerabilities
AI总结:
针对现有漏洞检测方法未利用漏洞模式、语句级识别精度不足的问题,本文提出基于学习到的漏洞码本匹配模式的检测方法,在18.8万函数的数据集上实现函数级、语句级F1值较SOTA分别提升6%、19%。
摘要:
深度学习(DL)模型在软件漏洞识别领域的应用日益广泛。已有研究发现,不同漏洞程序中的漏洞可能呈现出相似的漏洞范围,隐含形成可辨识的漏洞模式,DL模型可通过监督训练学习这些模式。然而,漏洞范围在程序内的空间位置和表现形式仍多种多样,给模型精准识别漏洞语句带来挑战。尽管存在这一挑战,当前最先进的漏洞检测方法仍未能利用漏洞程序中存在的漏洞模式。为充分利用漏洞模式并释放DL模型的能力,本文受基于预定义模式定位漏洞的程序分析工具启发,提出了一种新颖的漏洞匹配方法。具体而言,该方法学习得到一个漏洞码本(vulnerability codebook),其中包含代表各类漏洞模式的量化向量。在推理阶段,模型会遍历该码本,匹配所有已学习的模式,并预测给定程序中潜在漏洞的存在情况。我们在包含超过18.8万个C/C++函数的真实数据集上对所提方法进行了全面评估。评估结果显示,该方法在函数级和语句级漏洞识别任务上的F1值分别达到94%(较此前最优水平提升6%)和82%(较此前最优水平提升19%)。这些显著的性能提升凸显了该方法在漏洞识别方面的有效性。训练代码与预训练模型可访问https://github.com/optimatch/optimatch获取。
英文摘要:
Deep learning (DL) models have become increasingly popular in identifying software vulnerabilities. Prior studies found that vulnerabilities across different vulnerable programs may exhibit similar vulnerable scopes, implicitly forming discernible vulnerability patterns that can be learned by DL models through supervised training. However, vulnerable scopes still manifest in various spatial locations and formats within a program, posing challenges for models to accurately identify vulnerable statements. Despite this challenge, state-of-the-art vulnerability detection approaches fail to exploit the vulnerability patterns that arise in vulnerable programs. To take full advantage of vulnerability patterns and unleash the ability of DL models, we propose a novel vulnerability-matching approach in this paper, drawing inspiration from program analysis tools that locate vulnerabilities based on pre-defined patterns. Specifically, a vulnerability codebook is learned, which consists of quantized vectors representing various vulnerability patterns. During inference, the codebook is iterated to match all learned patterns and predict the presence of potential vulnerabilities within a given program. Our approach was extensively evaluated on a real-world dataset comprising more than 188,000 C/C++ functions. The evaluation results show that our approach achieves an F1-score of 94% (6% higher than the previous best) and 82% (19% higher than the previous best) for function and statement-level vulnerability identification, respectively. These substantial enhancements highlight the effectiveness of our approach to identifying vulnerabilities. The training code and pre-trained models are available at https://github.com/optimatch/optimatch.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。