CodeSAGE: A multi-feature fusion vulnerability detection approach using code attribute graphs and attention mechanisms

被引:0
作者
Zhang, Guodong [1 ]
Yao, Tianyu [1 ]
Qin, Jiawei [3 ]
Li, Yitao [3 ]
Ma, Qiao [4 ]
Sun, Donghong [2 ]
机构
[1] Shenyang Aerosp Univ, Sch Comp, Shenyang 110000, Liaoning, Peoples R China
[2] Tsinghua Univ, Inst Network Sci & Cyberspace, Beijing 100084, Peoples R China
[3] Coordinat Ctr China, Natl Comp Network Emergency Response Tech Team, Beijing 100029, Peoples R China
[4] Liaoning Branch Co, Coordinat Ctr China, Natl Comp Network Emergency Response Tech Team, Dalian 116021, Liaoning, Peoples R China
关键词
Software supply chain security; Code property graph; Simplification; Vulnerability detection; Feature fusion; FRAMEWORK;
D O I
10.1016/j.jisa.2025.103973
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
Software supply chain security is a critical aspect of modern computer security, with vulnerabilities being a significant threats. Identifying and patching these vulnerabilities promptly can significantly reduce security risks. Traditional detection methods cannot fully capture the complex structure of source code, leading to low accuracy. The neural network capacity limits machine learning-based methods, hindering effective feature extraction and impacting performance. In this paper, we propose a multi-feature fusion vulnerability detection technique called CodeSAGE. The method utilizes the Code Property Graph (CPG)1 to comprehensively display multiple logical structural relationships in the source code and combine it with GraphSAGE to aggregate the information of neighboring nodes in CPG to extract local features of the source code. Meanwhile, a Bi-LSTM combined with the attention mechanism is utilized to capture long-range dependencies in the logical structure of the source code and extract global features. The attention mechanism is used to assign weights to the two features, which are then fused to represent the syntactic and semantic information of the source code for vulnerability detection. A method for simplifying the CPG is proposed to mitigate the impact of graph size on model runtime and reduce redundant feature information. Irrelevant nodes are removed by weighting different edge types and filtering nodes exceeding a certain threshold, reducing the CPG size. To verify the effectiveness of CodeSAGE, comparative experiments are conducted on the SARD and CodeXGLUE datasets. The experimental results show that the CPG size can be reduced by 25%-45% using the simplified method, with an average time reduction of 20% per training round. Detection accuracy reached 99.12% on the SARD dataset and 73.57% on the CodeXGLUE dataset, outperforming the comparison methods.
引用
收藏
页数:13
相关论文
共 49 条
  • [1] International Telecommunication Union, Global Internet Penetration and Digital Infrastructure Development Report: Technical Report, (2023)
  • [2] Netflix, Continuous update, (2023)
  • [3] YouTube, Continuous update, (2023)
  • [4] Lakshmanan R., Wazirx cryptocurrency exchange loses $230 million in major security breach, (2024)
  • [5] Ladisa P., Plate H., Martinez M., Barais O., SoK: Taxonomy of attacks on open-source software supply chains, 2023 IEEE symposium on security and privacy, pp. 1509-1526, (2023)
  • [6] Hochreiter S., Schmidhuber J., Long short-term memory, Neural Comput, 9, 8, pp. 1735-1780, (1997)
  • [7] Hamilton W., Ying Z., Leskovec J., Inductive representation learning on large graphs, Adv Neural Inf Process Syst, 30, (2017)
  • [8] Vaswani A., Shazeer N., Parmar N., Uszkoreit J., Jones L., Gomez A.N., Et al., Attention is all you need, Adv Neural Inf Process Syst, 30, (2017)
  • [9] Senanayake J., Kalutarage H., Petrovski A., Piras L., Al-Kadri M.O., Defendroid: Real-time android code vulnerability detection via blockchain federated neural network with XAI, J Inf Secur Appl, 82, (2024)
  • [10] Eshghie M., Artho C., Gurov D., Dynamic vulnerability detection on smart contracts using machine learning, Proceedings of the 25th international conference on evaluation and assessment in software engineering, pp. 305-312, (2021)