Journal of Xidian University ›› 2024, Vol. 51 ›› Issue (4): 139-150.doi: 10.19665/j.issn1001-2400.20240306

• Computer Science and Technology & Cyberspace Security • Previous Articles     Next Articles

Graph neural network vulnerability detection for ethernet smart contracts

LI Xiaohan1(), YANG Yanbo1(), ZHANG Jiawei2(), LI Baoshan1(), MA Jianfeng2()   

  1. 1. School of Digtial and Intelligence Industry,Inner Mongolia University of Science & Technology,Baotou 014010,China
    2. School of Cyber Engineering,Xidian University,Xi’an 710071,China
  • Received:2023-10-03 Online:2024-08-20 Published:2024-03-21
  • Contact: YANG Yanbo E-mail:257459218@qq.com;yangyanbo@imust.edu.cn;jiaweizhang@xidian.edu.cn;libaoshan@imust.edu.cn;jfma@mail.xidian.edu.cn

Abstract:

A smart contract is an important part of the blockchain,and the Ethereum platform enables decentralized applications by deploying a large number of smart contracts,which is associated with billions of dollars worth of digital currency.However,a smart contract is a piece of code written in a high-level language,which can be vulnerable to attacks and cause huge economic losses.Currently,smart contract vulnerabilities are one of the serious threats to Ethereum.Traditional smart contract vulnerability detection methods rely heavily on fixed expert rules,resulting in low accuracy and time-consuming.In recent years,some researchers have used machine learning methods for vulnerability detection,but the detection methods they use do not fully utilize the semantic information of smart contract source code.In this paper,the smart contract source code is constructed as a smart contract graph with a data flow and control flow information,and the attention mechanism is utilized to assign different weights to the nodes in the graph according to their criticality to update the graph node features for contract vulnerability detection.In the paper,experiments are conducted on reentrant vulnerabilities and timestamp vulnerabilities.Experimental results show that compared with the traditional graph neural network detection model,the model in the paper improves the accuracy in the two vulnerability detections by 11.18% and 10.06%,respectively.The experiments demonstrate that smart contract vulnerabilities are not only related to the structural features of the contract code,but also closely related to different functions and data variables.

Key words: blockchain, ethereum, smart contracts, vulnerability detection, graph neural networks, attention mechanism

CLC Number: 

  • TP311.1