arrow
Return

DetectVul: A statement-level code vulnerability detection for Python

delete2025-02-01
delete0
PRE
AI
H
Hoai-Chau Tran
A
Anh-Duy Tran
K
Kim-Hung Le *
DOI:10.1016/j.future.2024.107504delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
Detecting vulnerabilities in source code using graph neural networks (GNN) has gained significant attention in recent years. However, the detection performance of these approaches relies highly on the graph structure, and constructing meaningful graphs is expensive. Moreover, they often operate at a coarse level of granularity (such as function-level), which limits their applicability to other scripting languages like Python and their effectiveness in identifying vulnerabilities. To address these limitations, we propose DetectVul, a new approach that accurately detects vulnerable patterns in Python source code at the statement level. DetectVul applies self-attention to directly learn patterns and interactions between statements in a raw Python function; thus, it eliminates the complicated graph extraction process without sacrificing model performance. In addition, the information about each type of statement is also leveraged to enhance the model's detection accuracy. In our experiments, we used two datasets, CVEFixes and Vudenc, with 211,317 Python statements in 21,571 functions from real-world projects on GitHub, covering seven vulnerability types. Our experiments show that DetectVul outperforms GNN-based models using control flow graphs, achieving the best F1 score of 74.47%, which is 25.45% and 18.05% higher than the best GCN and GAT models, respectively.
Keywords:
Source code vulnerability detection
Deep learning
Natural language processing

Journal

F
Future Generation Computer Systems-The International Journal of eScience
IF:
6.1
Papers:
6.9K
Citations:
2.3W

Organization

V
vnu-hcm university of science (vnuhcm-us)
Scholars:
497
Papers: 367
Citations: 0
researcher View more organizations
Cited Papers

Cited Papers

errShare
errSave
VulDeeLocator: A Deep Learning-Based Fine-Grained Vulnerability Detector
err2022-07-01
err87
errOAAI
errLi, Zhen; Zou, Deqing; Xu, Shouhuai; Chen, Zhaoxuan; Zhu, Yawei; Jin, Hai
errShare
errSave
SySeVR: A Framework for Using Deep Learning to Detect Software Vulnerabilities
err2022-07-01
err261
errOAAI
errLi, Zhen; Zou, Deqing; Xu, Shouhuai; Jin, Hai; Zhu, Yawei; Chen, Zhaoxuan
errShare
errSave
VUDENC: Vulnerability Detection with Deep Learning on a Natural Codebase for Python
err2022-04-01
err57
errOAAI
errWartschinski, Laura; Noller, Yannic; Vogel, Thomas; Kehrer, Timo; Grunske, Lars
errShare
errSave
errShare
errSave
Making the Right Stuff
err1989-08-12
err0
PREAI
errIvan Amato
errShare
errSave
An empirical study of security warnings from static application security testing tools
err2019-12-01
err28
PREAI
errAloraini, Bushra; Nagappan, Meiyappan; German, Daniel M.; Hayashi, Shinpei; Higo, Yoshiki
errShare
errSave
researcher View more