Skip to main content
QUICK REVIEW

[论文解读] Automatic feature learning for vulnerability prediction

Hoa Khanh Dam, Truyen Tran|arXiv (Cornell University)|Aug 8, 2017
Software Engineering Research参考文献 27被引用 90
一句话总结

本论文提出一种深度学习方法,使用 Long Short-Term Memory (LSTM) 自动从代码中学习语义和句法特征以预测软件漏洞,达到与最先进模型竞争甚至优越的效果。

ABSTRACT

Code flaws or vulnerabilities are prevalent in software systems and can potentially cause a variety of problems including deadlock, information loss, or system failure. A variety of approaches have been developed to try and detect the most likely locations of such code vulnerabilities in large code bases. Most of them rely on manually designing features (e.g. complexity metrics or frequencies of code tokens) that represent the characteristics of the code. However, all suffer from challenges in sufficiently capturing both semantic and syntactic representation of source code, an important capability for building accurate prediction models. In this paper, we describe a new approach, built upon the powerful deep learning Long Short Term Memory model, to automatically learn both semantic and syntactic features in code. Our evaluation on 18 Android applications demonstrates that the prediction power obtained from our learned features is equal or even superior to what is achieved by state of the art vulnerability prediction models: 3%--58% improvement for within-project prediction and 85% for cross-project prediction.

研究动机与目标

  • 将漏洞预测确立为一项具有高价值的早期安全任务。
  • 通过直接从代码中学习表示来克服手工设计特征的局限性。
  • 捕捉语义和句法信息,以提升同一项目内和跨项目的预测性能。

提出的方法

  • 将每个 Java 文件表示为一个头部加方法;将其解析为每个方法的标记序列。
  • 训练一个 LSTM 来学习标记嵌入和动态标记状态,以形成方法向量。
  • 对方法向量进行池化以获得文件的句法特征;通过跨项目对标记状态进行聚类,构建语义代码本。
  • 通过代码本聚类和语义池化生成语义特征,以实现跨项目的泛化。
  • 在学习到的特征上训练一个漏洞分类器(随机森林),并与基线方法进行比较。

实验结果

研究问题

  • RQ1RQ1:通过 LSTM 自动学习的特征能否实现有效的同一项目内漏洞预测?
  • RQ2RQ2:在同一应用的跨版本漏洞预测中,该方法的表现如何?
  • RQ3RQ3:在跨不同应用的跨项目漏洞预测中,该方法是否有效?
  • RQ4RQ4:与软件度量、词袋模型(Bag-of-Words)和深度信念网络基线相比,所提方法的效果如何?

主要发现

  • 同一项目内的结果在多款应用中与基准相比具有竞争力甚至优于之。
  • 该方法在使用联合句法和语义特征时实现了较高的精确度和召回率。
  • 通过代码本聚类得到的语义特征改善了跨项目的泛化。
  • 在跨项目设定中相比某些基线取得显著改进(例如跨项目预测达到最高 85%)。
  • 实验使用了 18 个 Android 应用,进行同一项目内评估的十折交叉验证。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。