An Unbiased Transformer Source Code Learning with Semantic Vulnerability Graph

Nafis Tanveer Islam, Gonzalo De La Torre Parra, Dylan Manuel, Elias Bou-Harb, Peyman Najafirad
4/17/2023
cs.CRcs.AIcs.LG

No official code found. Best implementation: pial08/SemVulDet (10 stars, MIT, last commit 2023-07-19).

Abstract

Over the years, open-source software systems have become prey to threat actors. Even as open-source communities act quickly to patch the breach, code vulnerability screening should be an integral part of agile software development from the beginning. Unfortunately, current vulnerability screening techniques are ineffective at identifying novel vulnerabilities or providing developers with code vulnerability and classification. Furthermore, the datasets used for vulnerability learning often exhibit distribution shifts from the real-world testing distribution due to novel attack strategies deployed by adversaries and as a result, the machine learning model's performance may be hindered or biased. To address these issues, we propose a joint interpolated multitasked unbiased vulnerability classifier comprising a transformer "RoBERTa" and graph convolution neural network (GCN). We present a training process utilizing a semantic vulnerability graph (SVG) representation from source code, created by integrating edges from a sequential flow, control flow, and data flow, as well as a novel flow dubbed Poacher Flow (PF). Poacher flow edges reduce the gap between dynamic and static program analysis and handle complex long-range dependencies. Moreover, our approach reduces biases of classifiers regarding unbalanced datasets by integrating Focal Loss objective function along with SVG. Remarkably, experimental results show that our classifier outperforms state-of-the-art results on vulnerability detection with fewer false negatives and false positives. After testing our model across multiple datasets, it shows an improvement of at least 2.41% and 18.75% in the best-case scenario. Evaluations using N-day program samples demonstrate that our proposed approach achieves a 93% accuracy and was able to detect 4, zero-day vulnerabilities from popular GitHub repositories.

View on arXivView PDF

Code Implementations(1)

pial08/SemVulDetCommunity100%
MIT
102C++, ShellJul 30, 20223 years agoMIT

Similar Papers

Cite this paper

@article{islam2023unbiased,
  title  = {An Unbiased Transformer Source Code Learning with Semantic Vulnerability Graph},
  author = {Nafis Tanveer Islam and Gonzalo De La Torre Parra and Dylan Manuel and Elias Bou-Harb and Peyman Najafirad},
  year   = {2023},
  eprint = {2304.11072},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2304.11072v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2304.11072.svg)](https://codeofpaper.com/paper/2304.11072)

Discussion