引用本文
  • 张人娄,吴胜,张浩,刘方宇.Slice-GCN:基于程序切片与图神经网络的智能合约漏洞检测方法[J].信息安全学报,2025,10(1):105-118    [点击复制]
  • ZHANG Renlou,WU Sheng,ZHANG Hao,LIU Fangyu.Slice-GCN: Smart Contract Vulnerability Detection Based on Program Slicing and Graph Neural Networks[J].Journal of Cyber Security,2025,10(1):105-118   [点击复制]
【打印本页】 【下载PDF全文】 查看/发表评论下载PDF阅读器关闭

←前一篇|后一篇→

过刊浏览    高级检索

本文已被:浏览 89次   下载 28 本文二维码信息
码上扫一扫!
Slice-GCN:基于程序切片与图神经网络的智能合约漏洞检测方法
张人娄, 吴胜, 张浩, 刘方宇
0
(江苏师范大学 计算机科学与技术学院 徐州 中国 211116)
摘要:
智能合约是一段由计算机代码构成的程序。随着智能合约数量的暴涨,如何利用漏洞检测方法来提升智能合约的安全性显得更加重要。已有的符号执行、模糊测试与形式化验证等漏洞检测方法自动化程度低,而基于序列模型的深度学习方法由于对智能合约源代码的特征挖掘不足导致检测结果的精度偏低。因此,本文提出一个基于程序切片与图神经网络的以太坊智能合约(简称智能合约)漏洞检测方法Slice-GCN。该方法先对程序进行代码预处理简化程序,再使用基于图可达性和数据流方程的程序切片方法对预处理后的程序进行切片,并将切片结果输入长短期记忆网络(LSTM)中提取智能合约的程序语义特征。接着,简化程序依赖图后将其输入图卷积神经网络中,并提取智能合约的程序结构特征。然后,将智能合约的程序语义特征和结构特征拼接后输入多层感知机(MLP)中,并对智能合约进行漏洞检测。在提出Slice-GCN方法的基础上,针对重入攻击、时间戳依赖及整数溢出三类漏洞,本文对Slice-GCN方法与Oyente、Osiris和Soliditycheck三款智能漏洞检测工具进行了对比实验,并且通过消融实验分析了程序切片、图神经网络及图收缩比例对实验结果的影响。实验结果表明本文提出的方法在各类指标上均有较大提升,能有效提升检测准确度和精度,降低误报率,同时在检测速度上也明显优于传统的智能合约漏洞检测工具。
关键词:  智能合约  漏洞检测  图神经网络  程序切片
DOI:10.19363/J.cnki.cn10-1380/tn.2025.01.08
投稿时间:2023-03-15修订日期:2023-08-08
基金项目:本课题得到江苏师范大学科研与实践创新项目(No.2022XKT1548)资助
Slice-GCN: Smart Contract Vulnerability Detection Based on Program Slicing and Graph Neural Networks
ZHANG Renlou, WU Sheng, ZHANG Hao, LIU Fangyu
(College of Computer Science and Technology, Jiangsu Normal University, Xuzhou 211116, China)
Abstract:
A smart contract is a program made up of computer code. With the skyrocketing number of smart contracts, how to use vulnerability detection methods to improve the security of smart contracts becomes more important. Existing vulnerability detection methods such as symbolic execution, fuzz testing, and formal verification have a low degree of automation, while deep learning methods based on sequence models have low detection accuracy due to insufficient feature mining of smart contract source code. Therefore, this paper proposes a vulnerability detection method Slice-GCN for Ethereum smart contracts (smart contracts for short) based on program slices and graph neural networks. This method first preprocesses the code of the program to simplify the program, and then uses the program slicing method based on graph accessibility and data flow equations to slice the preprocessed program, and input the slicing results into the long short-term memory network (LSTM) to extract the program semantic features of the smart contract. Then, the simplified program dependency graph is fed into the graph convolutional neural network, and the program structure features of the smart contract are extracted. Then, the program semantic features and structural features of the smart contract are spliced and input into the multi-layer perceptron (MLP), and the smart contract is tested for vulnerabilities. On the basis of proposing the Slice-GCN method, aiming at the reentrancy attack, timestamp dependency and integer overflow three types of vulnerabilities, this paper compared the Slice-GCN method with three smart contract vulnerability detection tools Oyente, Osiris and Soliditycheck, and passed the ablation experiments analyze the effects of program slicing, graph neural network, and graph shrinkage ratio on the experimental results. The experimental results show that the method proposed in this paper has greatly improved various indicators, can effectively improve the detection accuracy and precision, and reduce the false positive rate. At the same time, the detection speed is also significantly better than the traditional smart contract vulnerability detection tools.
Key words:  smart contract  vulnerability detection  graph neural network  program slicing