Affiliation:
1. Department of Electrical and Computer Engineering, Concordia University, Montréal, QC H4B 1R6, Canada
Abstract
Software vulnerability detection aims to proactively reduce the risk to software security and reliability. Despite advancements in deep-learning-based detection, a semantic gap still remains between learned features and human-understandable vulnerability semantics. In this paper, we present an XAI-based framework to assess program code in a graph context as feature representations and their effect on code vulnerability classification into multiple Common Weakness Enumeration (CWE) types. Our XAI framework is deep-learning-model-agnostic and programming-language-neutral. We rank the feature importance of 40 syntactic constructs for each of the top 20 distributed CWE types from three datasets in Java and C++. By means of four metrics of information retrieval, we measure the similarity of human-understandable CWE types using each CWE type’s feature contribution ranking learned from XAI methods. We observe that the subtle semantic difference between CWE types occurs after the variation in neighboring features’ contribution rankings. Our study shows that the XAI explanation results have approximately 78% Top-1 to 89% Top-5 similarity hit rates and a mean average precision of 0.70 compared with the baseline of CWE similarity identified by the open community experts. Our framework allows for code vulnerability patterns to be learned and contributing factors to be assessed at the same stage.
Funder
Canada Natural Sciences and Engineering Research Council Discovery Grant
Reference90 articles.
1. National Institute of Standards and Technology (NIST) (2012). Vulnerability Definition.
2. Automatic feature learning for predicting vulnerable software components;Dam;IEEE Trans. Softw. Eng.,2019
3. μVulDeePecker: A Deep Learning-Based System for Multiclass Vulnerability Detection;Zou;IEEE Trans. Dependable Secur. Comput.,2019
4. Software vulnerability analysis and discovery using machine-learning and data-mining techniques: A survey;Ghaffarian;ACM Comput. Surv. (CSUR),2017
5. Evaluating complexity, code churn, and developer activity metrics as indicators of software vulnerabilities;Shin;IEEE Trans. Softw. Eng.,2010