计算机科学 ›› 2026, Vol. 53 ›› Issue (10): 464-475.doi: 10.11896/jsjkx.250800080
陈虹1, 王明君1, 金海波1, 武聪2, 芦奇1
CHEN Hong1, WANG Mingjun1, JIN Haibo1, WU Cong2, LU Qi1
摘要: 针对智能合约安全漏洞检测中静态分析高误报与动态分析低效率导致准确率低的问题,提出一种融合时序特征图神经网络(Fusion of Temporal-Feature Graph Neural Network,FTF-GNN)的智能合约漏洞检测方法。首先,通过静态分析提取专家模式特征Pr与图特征Gr,Pr降低盲目检测导致的误报,Gr避免全图遍历瓶颈;其次,基于风险概率阈值λ筛选高危函数,提升整体分析效率;再次,构建时序图神经网络,通过自注意力机制强化复杂漏洞捕捉能力;最后,聚焦于可重入漏洞和时间戳依赖漏洞检测。在以太坊和VNT链双平台真实合约数据集上进行评估,实验表明,该模型对可重入漏洞检测准确率达93.12%、F1值达94.41%,比现有对比方法最优者提升0.31个百分点和2.73个百分点,对检测时间戳依赖漏洞准确率达91.71%、F1值达92.47%,比现有对比方法最优者提升0.07个百分点和1.10个百分点。
中图分类号:
| [1] SZABO N.Formalizing andsecuring relation-ships on public networks [J].First Monday,1997,2:9. [2] CHEN J F,WANG Z X,CAI S H,et al.Vulnerability detection method for blockchain smart contracts based on metamorphic testing[J].Journal on Communications,2023,44(10):164-176. [3] WANG Z X,WEN B.Smart Contract Vulnerability Detection of Symbol Execution with Critical Path Pre-Searching [J].Journal of Applied Sciences,2024,42(2):364-374. [4] MUELLER B.Mythril-reversing and bug hunting frameworkfor the ethereum blockchain[EB/OL].[2022-01-16].https://pypi.org/project/mythril/0.8.2,2017. [5] BAI Y M,SHI Z B,XIN W G,et al.Research on Smart Contract Vulnerability Detection Method Based on Word Embedding and Shapelet Time Series Features [J].Journal of North University of China(Natural Science Edition),2023,44(4):381-387. [6] MA F,XU Z,REN M,et al.Pluto:Exposing vulnerabilities in intercontract scenarios [J].IEEE Transactions on Software Engineering,2021,48(11):4380-4396. [7] LIU Z,QIAN P,YANG J,et al.Rethinking smart contractfuzzing:Fuzzing with invocation ordering and important branch revisiting [J].IEEE Transactions on Information Forensics and Security,2023,18:1237-1251. [8] CHEN K X,LIU J Y,JIA P.An Score Oriented Fuzzing Method for Smart Contracts [J].Modern Computer,2022,28(8):36-41. [9] XIAO P,ZHANG X S,YANG F Y,et al.Vulnerability Detection Based on Deep Graph Convolutional Network and Attention Mechanism [J].Computer Engineering and Applications,2024,60(3):292-298. [10] LIU Z,QIAN P,WANG X,et al.Combining graph neural networks with expert knowledge for smart contract vulnerability detection [J].IEEE Transactions on Knowledge and Data Engineering,2021,35(2):1296-1310. [11] FAN Y Q,SHANG S Y,DING X.Smart Contract Vulnerability Detection Based on Dual Attention Graph Convolutional Network[C]//Proceedings of the International Conference on Collaborative Computing:Networking,Applications and Worksharing.Berlin:Springer,2021:335-351. [12] CHEN D,FENG L,FAN Y,et al.Smart contract vulnerability detection based on semantic graph and residual graph convolutional networks with edge attention [J].Journal of Systems and Software,2023,202:111705. [13] HE L,ZHAO X,WANG Y,et al.Graphsa:Smart contract vulnerability detection combining graph neural networks and static analysis[C]//26th European Conference on Artificial Intelligence(ECAI).IOS Press,2023:1020-1027. [14] HUANG J,HAN S M,YOU W,et al.Hunting vulnerable smart contracts via graph embedding based bytecode matching [J].IEEE Transactions on Information Forensics and Security,2021,16:2144-2156. [15] LIN Y J,ZHANG Y.Integer Overflow Vulnerability Detection Based on the Fusion of Semantics and Structural Features [J].Journal of Hubei University(Natural Science Edition),2024,46(4):531-539. [16] XUE J L,LI B,ZHANG J L,et al.A smart Contract Defect Detection Method Based on Transfer Learning [J].Journal of Yang-zhou University(Natural Science Edition),2023,26(4):25-30. [17] KIPF T N.Semi-supervised classification with graph convolu-tional networks[J].arXiv:1609.02907,2016. [18] ZHUANG Y,LIU Z,QIAN P,et al.Smart Contract Vulnerabi-lity Detection Using Graph Neural Networks[C]//Proceedings of the Twenty-ninth International Conference on International Joint Conferences on Artificial Intelligence.2021:3283-3290. [19] LI X,DU J L,CHEN Z W,et al.Smart Contract Vulnerability Detection Method Based on Dual Channel [J].Science Techno-logy and Engineering,2023,23(34):14651-14659. [20] SHI Z T,SHI Z B,LIU D M,et al.Feature-Wise ModulationGraph Neural Network Smart Contract Vulnerability Detection Based on Source Code [J].Journal of North University of China(Natural Science Edition),2024,45(5):601-607. [21] LI X H,YANG Y B,ZHANG J W,et al.Graph Neural Network Vulnerability Detection for Ethernet Smart Contracts [J].Journal of Xidian University,2024,51(4):139-150. [22] ZHOU T,DU Y P,XIE R F,et al.Vulnerability Detection Method Based on Deep Fusion of Multi-dimensional Features from Heterogeneous Contract Graphs [J].Computer Science,2025,52(9):368-375. [23] LI C Y,HUANG K,ZHANG R H,et al.A Heterogeneous Graph Attention Network-Based Approach for Smart Contract Vulnerability Detection [J].Computer Science,2026,53(2):423-430. [24] SONG J H,CAO K,ZHANG Y.Smart Contract Bytecode Vulnerability Detection Method Based on Heterogeneous Graphs and Instruction Sequences [J].Computer Science,2025,52(12):367-373. [25] ANTONOPOULOS A M,WOOD G.Mastering ethereum:buil-ding smart contracts and dapps[M].O’reilly Media,2018. [26] ZENG Q R,HE J H,ZHAO G S,et al.EtherGIS:A Vulnerability Detection Framework for Ethereum Smart Contracts Based on Graph Learning Features [C]//Proceedings of the 2022 IEEE 46th Annual Computers,Software,and Applications Conference(COMPSAC).Piscataway,NJ:IEEE,2022:1742-1749. [27] WANG S L.A Source Code Vulnerability Detection SchemeBased on Code Sequence and Graph Structure [J].Journal of North University of China(Natural Science Edition),2023,44(6):641-653. [28] YING Z B,SONG L C,CHEN D,et al.AWIBS:An adaptive weight incentive for blockchain sharding [J].Journal of Information and Intelligence,2023,1(2):87-103. |
|
||