DetectVul: A statement-level code vulnerability detection for Python

Abstract

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 …

Publication
Future Generation Computer Systems
FieldDetails
Volume163
Pages107504
PublisherNorth-Holland
Scholar articlesDetectVul: A statement-level code vulnerability detection for Python - HC Tran, AD Tran, KH Le - Future Generation Computer Systems, 2025 - Cited by 6 Related articles All 2 versions