A Method to Detect Vulnerability of Java Source Code based on AST and Graph Attention Networks

It is crucial to Detecting vulnerabilities in source code at the beginning of projects. Traditional source code vulnerability detection algorithms are hard to represent the feature information and the relationships between code blocks. To address these issues, this paper uses abstract syntax tree to represent the feature of source code. This paper adds data dependency edges and control dependency edges to the original AST, transforming the tree-structured AST into a graph-structured Enhanced-AST in order to solve the limited ability of the original AST to represent data flow and control flow. Word2Vec algorithm is used for embedding Enhanced-AST nodes, and Graph Attention Networks (GAT), which introduces an attention mechanism to better capture the dependencies and important information between nodes, are used to learn the feature information of Enhanced-AST. This paper collects Java CWE vulnerability datasets from the SARD dataset, implements a function-level vulnerability detection method based on the dataset, and compares it with BiLSTM and method using AST to extract code features. Experimental results show that the proposed method achieves optimal F1 values in most cases.

Authors

Publication Details

Published
2024-08-16
DOI
https://doi.org/10.1109/icste63875.2024.00010
Primary Topic
Software Engineering Research
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

A Method to Detect Vulnerability of Java Source Code based on AST and Graph Attention Networks

Jin Zhu, Jinsheng Xiao, Rui Luo, Hui Ge
Software Engineering Research
article

A Method to Detect Vulnerability of Java Source Code based on AST and Graph Attention Networks

Jin Zhu, Jinsheng Xiao, Rui Luo, Hui Ge
article en

Abstract

It is crucial to Detecting vulnerabilities in source code at the beginning of projects. Traditional source code vulnerability detection algorithms are hard to represent the feature information and the relationships between code blocks. To address these issues, this paper uses abstract syntax tree to represent the feature of source code. This paper adds data dependency edges and control dependency edges to the original AST, transforming the tree-structured AST into a graph-structured Enhanced-AST in order to solve the limited ability of the original AST to represent data flow and control flow. Word2Vec algorithm is used for embedding Enhanced-AST nodes, and Graph Attention Networks (GAT), which introduces an attention mechanism to better capture the dependencies and important information between nodes, are used to learn the feature information of Enhanced-AST. This paper collects Java CWE vulnerability datasets from the SARD dataset, implements a function-level vulnerability detection method based on the dataset, and compares it with BiLSTM and method using AST to extract code features. Experimental results show that the proposed method achieves optimal F1 values in most cases.

Openalex Percentile: Top 58%
Software Engineering Research
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.