Limits of Machine Learning for Automatic Vulnerability Detection

06/28/2023
by   Niklas Risse, et al.
0

Recent results of machine learning for automatic vulnerability detection have been very promising indeed: Given only the source code of a function f, models trained by machine learning techniques can decide if f contains a security flaw with up to 70 But how do we know that these results are general and not specific to the datasets? To study this question, researchers proposed to amplify the testing set by injecting semantic preserving changes and found that the model's accuracy significantly drops. In other words, the model uses some unrelated features during classification. In order to increase the robustness of the model, researchers proposed to train on amplified training data, and indeed model accuracy increased to previous levels. In this paper, we replicate and continue this investigation, and provide an actionable model benchmarking methodology to help researchers better evaluate advances in machine learning for vulnerability detection. Specifically, we propose (i) a cross validation algorithm, where a semantic preserving transformation is applied during the amplification of either the training set or the testing set, and (ii) the amplification of the testing set with code snippets where the vulnerabilities are fixed. Using 11 transformations, 3 ML techniques, and 2 datasets, we find that the improved robustness only applies to the specific transformations used during training data amplification. In other words, the robustified models still rely on unrelated features for predicting the vulnerabilities in the testing data. Additionally, we find that the trained models are unable to generalize to the modified setting which requires to distinguish vulnerable functions from their patches.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
12/15/2022

An Empirical Study of Deep Learning Models for Vulnerability Detection

Deep learning (DL) models of code have recently reported great progress ...
research
02/06/2022

Featherweight Assisted Vulnerability Discovery

Predicting vulnerable source code helps to focus attention on those part...
research
05/16/2021

Improving Vulnerability Prediction of JavaScript Functions Using Process Metrics

Due to the growing number of cyber attacks against computer systems, we ...
research
03/22/2021

Shallow or Deep? An Empirical Study on Detecting Vulnerabilities using Deep Learning

Deep learning (DL) techniques are on the rise in the software engineerin...
research
01/20/2022

VUDENC: Vulnerability Detection with Deep Learning on a Natural Codebase for Python

Context: Identifying potential vulnerable code is important to improve t...
research
03/17/2021

Code Word Detection in Fraud Investigations using a Deep-Learning Approach

In modern litigation, fraud investigators often face an overwhelming num...
research
04/24/2023

SQLi Detection with ML: A data-source perspective

Almost 50 years after the invention of SQL, injection attacks are still ...

Please sign up or login with your details

Forgot password? Click here to reset