摘要
随着区块链技术的广泛应用,智能合约的内部逻辑越来越复杂。然而,目前大多数智能合约漏洞检测方法存在假阳性率高、检测准确率低等问题。为此,文章提出一种基于双注意力机制图神经网络的智能合约漏洞检测方法,用于智能合约漏洞检测,旨在提升检测的准确性和效率。文章在图卷积网络的卷积层中引入了多头注意力机制,并在特征传播阶段动态计算邻接节点信息对应的注意力权重。该机制使模型在特征聚合时更加关注与当前节点最相关的邻居节点,从而提升对重要特征的辨识能力。在图池化阶段,采用注意力池化机制选择和聚合节点特征,进一步提升对关键节点的关注度,提高了对漏洞检测影响较大特征的识别能力。文章采用以太坊智能合约漏洞样本数据集(ESC)进行实验,实验结果表明,与其他检测技术相比,文章所提方法在识别复杂智能合约漏洞方面具有更快的检测速度和更高的准确性。
With the widespread adoption of blockchain technology,an increasing number of smart contracts exhibiting complex internal logic are being deployed.However,most existing methods for detecting vulnerabilities in smart contracts suffer from high false positive rates and low detection accuracy.To address these challenges,this paper proposed a smart contract vulnerability detection method based on graph convolutional network with dual attention mechanism,aiming to improve both the accuracy and efficiency of the detection process.Initially,a multi-head attention mechanism was integrated into the convolutional layer of the graph convolutional network,enabling the dynamic calculation of attention weights based on the information from adjacent nodes during the feature propagation stage.This enhancement allowed the model to concentrate more on the neighbors most relevant to the current node during each feature aggregation,thereby improving the recognition of critical features.Subsequently,during the graph pooling stage,an attention-based pooling mechanism was employed to select and aggregate node features,further emphasizing key nodes and enhancing the identification of features that significantly influence vulnerability detection.The proposed method was evaluated using the ethereum smart contract(ESC)vulnerability sample dataset.Experimental results demonstrate that compared to other detection techniques,the proposed method can identify complex smart contract vulnerabilities with greater speed and accuracy.
作者
李鹏超
张全涛
胡源
LI Pengchao;ZHANG Quantao;HU Yuan(Department of Information Security,Chongqing Police College,Chongqing 401331,China;School of Computer and Information Science,Southwest University,Chongqing 400715,China;Hechuan Branch of Chongqing Public Security Bureau,Chongqing 400153,China)
出处
《信息网络安全》
CSCD
北大核心
2024年第11期1624-1631,共8页
Netinfo Security
基金
重庆市教育委员会科学技术研究项目(KJQN202301701)
重庆市教育委员会科学技术研究项目(KJZD-K202201701)。
关键词
智能合约
漏洞检测
注意力机制
图神经网络
smart contract
vulnerability detection
attention mechanism
graph convolutional network