Journal of Information Security Reserach ›› 2024, Vol. 10 ›› Issue (11): 1056-.

Previous Articles     Next Articles

Reentrancy Vulnerability Detection Method in Smart Contracts #br# Based on Hybrid Model and Attention Mechanism#br#

Shen Xueli and Li Mingfeng   

  1. (College of Software, Liaoning Technical University, Huludao, Liaoning 125105)
  • Online:2024-11-10 Published:2024-11-22

基于混合模型和注意力机制的智能合约重入漏洞检测方法

沈学利李明峰   

  1. (辽宁工程技术大学软件学院辽宁葫芦岛125105)
  • 通讯作者: 李明峰 硕士研究生.主要研究方向为网络与信息安全. mf.li0221@qq.com
  • 作者简介:沈学利 博士,教授,CCF高级会员.主要研究方向为计算机网络及信息安全、智能信息处理. shenxueli@lntu.edu.cn 李明峰 硕士研究生.主要研究方向为网络与信息安全. mf.li0221@qq.com

Abstract: Addressing the challenges of low efficiency and accuracy in reentrancy vulnerability detection by traditional smart contract vulnerability detection tools and single deep learning models, this paper proposes a reentrancy vulnerability detection method based on hybrid model and attention mechanism (CNNBiLSTMATT). Firstly, data processing is performed using the Word2vec model to obtain feature vectors. Secondly, these vectors undergo processing through a combination of convolutional neural network (CNN) and bidirectional long shortterm memory (BiLSTM) networks to extract features. The attention mechanism then assigns weights to highlight key features. Finally, a fully connected layer and Softmax classifier are utilized to classify the generated results, enabling reentrancy vulnerability detection in smart contracts. The experimental results demonstrate that compared with the traditional tools and deep learning methods, the method based on CNNBiLSTMATT proposed in this paper has been greatly improved in reentrant vulnerability detection. The accuracy, precision, recall rate and F1 value reached 92.53%, 93.27%, 91.73% and 92.5% respectively, confirming the effectiveness of the proposed method.

Key words: smart contract, reentrancy vulnerability, vulnerability detection, hybrid model, attention mechanism

摘要: 针对传统智能合约漏洞检测工具和单一深度学习模型对重入漏洞检测效率和精确率低等问题,提出了一种基于混合模型和注意力机制的重入漏洞检测方法(CNNBiLSTMATT).首先,使用单词嵌入模型(Word2vec)进行数据处理并得到特征向量;然后,将处理后的特征向量通过卷积神经网络(CNN)和双向长短期记忆网络(BiLSTM)相结合的方法进行特征提取,并通过注意力机制赋予权重以突出关键特征;最后,采用全连接层和Softmax分类器对生成的结果进行分类,实现智能合约的重入漏洞检测.实验结果表明,与传统工具和深度学习方法相比,基于CNNBiLSTMATT的方法在重入漏洞检测方面有较大的提升,准确率、精确率、召回率和F1值分别达到了92.53%,93.27%,91.73%,92.5%,证明该方法的有效性.

关键词: 智能合约, 重入漏洞, 漏洞检测, 混合模型, 注意力机制

CLC Number: