通过细粒度语义表示学习与解释区分外观相似的无害代码与脆弱代码
Distinguishing Look-Alike Innocent and Vulnerable Code by Subtle Semantic Representation Learning and Explanation
AI总结:
针对现有深度学习脆弱性检测方法在词法相似语义相反的函数上预测差、无直观解释的问题,提出SVulD方法,学习区分性语义表示并提供自然语言解释,在多项指标上显著优于SOTA方法,且获开发者实践认可。
摘要:
尽管已有许多基于深度学习(DL)的脆弱性检测方法被提出,且确实取得了显著效果,但它们在泛化性和实际应用方面仍存在局限。更具体地说,现有基于DL的方法存在两个问题:一是在词法相似但语义相反的函数之间的预测任务上表现不佳;二是无法为检测结果提供面向开发者的直观解释。\n本文提出了一种名为SVulD的新方法,即带直观解释的函数级细粒度语义嵌入脆弱性检测方法,以缓解上述局限。具体而言,SVulD首先训练一个模型,学习函数的区分性语义表示,不受其词法相似性的影响。随后,对于检测到的脆弱函数,SVulD会提供结果的自然语言解释(如根本原因),帮助开发者直观理解脆弱性。\n为评估SVulD的有效性,我们在一个广泛使用的实用脆弱性数据集上开展了大规模实验,采用五项性能指标,将其与四种最先进(SOTA)方法进行对比。实验结果表明,SVulD的性能优于所有SOTA方法,提升幅度显著:F1值提升23.5%-68.0%,PR-AUC提升15.9%-134.8%,准确率提升7.4%-64.4%。此外,我们开展了用户案例研究,评估SVulD对开发者理解脆弱代码的实用性,参与者反馈表明SVulD对开发实践有帮助。
英文摘要:
Though many deep learning (DL)-based vulnerability detection approaches have been proposed and indeed achieved remarkable performance, they still have limitations in the generalization as well as the practical usage. More precisely, existing DL-based approaches (1) perform negatively on prediction tasks among functions that are lexically similar but have contrary semantics; (2) provide no intuitive developer-oriented explanations to the detected results. In this paper, we propose a novel approach named SVulD, a function-level Subtle semantic embedding for Vulnerability Detection along with intuitive explanations, to alleviate the above limitations. Specifically, SVulD firstly trains a model to learn distinguishing semantic representations of functions regardless of their lexical similarity. Then, for the detected vulnerable functions, SVulD provides natural language explanations (e.g., root cause) of results to help developers intuitively understand the vulnerabilities. To evaluate the effectiveness of SVulD, we conduct large-scale experiments on a widely used practical vulnerability dataset and compare it with four state-of-the-art (SOTA) approaches by considering five performance measures. The experimental results indicate that SVulD outperforms all SOTAs with a substantial improvement (i.e., 23.5%-68.0% in terms of F1-score, 15.9%-134.8% in terms of PR-AUC and 7.4%-64.4% in terms of Accuracy). Besides, we conduct a user-case study to evaluate the usefulness of SVulD for developers on understanding the vulnerable code and the participants' feedback demonstrates that SVulD is helpful for development practice.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。