Smart Contract Vulnerability Detection Based on Hybrid Attention Mechanism Model
Source abstract
Abstract
A smart contract, as an important part of blockchain technology, has attracted considerable interest from both industry and academia. It provides the basis for the realization of a variety of practical blockchain applications and plays a crucial role in the blockchain ecosystem. While it also holds a large number of digital assets, the frequent occurrence of smart contract vulnerabilities have caused huge economic losses and destroyed the blockchain-based credit system. Currently, the security and reliability of smart contracts have become a new focus of research, and there are a number of smart contract vulnerability detection methods, such as traditional detection tools based on static or dynamic analysis. However, most of them often rely on expert rules, and therefore have poor scalability and high false negative and false positive rates. Recent deep learning methods alleviate this issue, but without considering the semantic information and context of source code. To this end, we propose a hybrid attention mechanism (HAM) model to detect security vulnerabilities in smart contracts. We extract code fragments from the source code, which focus on key points of vulnerability. We conduct extensive experiments on two public smart contract datasets (a total of 24,957 contracts). Empirical results show remarkable accuracy improvement over the state-of-the art methods on five kinds of vulnerabilities, where the detection accuracy could achieve 93.36%, 80.85%, 82.56%, 85.62%, and 82.19% for reentrancy, arithmetic vulnerability, unchecked return value, timestamp dependency, and tx.origin, respectively.
Source: crossref · Quality: baseline
Research context
OpenAlex topics: Blockchain Technology Applications and Security · Cybercrime and Law Enforcement Studies · Advanced Malware Detection Techniques
SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.
Affiliations
College of Computer and Communication Engineering, Zhengzhou University of Light Industry, Zhengzhou 450001, China
Henan Key Laboratory of Network Cryptography Technology, Zhengzhou 450001, China
Funding
Major Public Welfare Projects Foundation of Henan Province · Open Foundation of Henna Key Laboratory Cryptography
References (59)
Show source-provided references
1. Blockchain challenges and opportunities: A survey10.1504/IJWGS.2018.095647 ↗
2. Bitcoin: A peer-to-peer electronic cash system
3. Hofman, D.L. (August, January 31). Legally speaking: Smart contracts, archival bonds, and linked data in the blockchain. Proceedings of the 2017 26th International Conference on Computer Communication and Networks (ICCCN), Vancouver, BC, Canada.10.1109/ICCCN.2017.8038515 ↗
4. Blockchain technology and its relationships to sustainable supply chain management10.1080/00207543.2018.1533261 ↗
5. Chen, S., Shi, R., Ren, Z., Yan, J., Shi, Y., and Zhang, J. (2017, January 4–6). A blockchain-based supply chain quality management framework. Proceedings of the 2017 IEEE 14th International Conference on e-Business Engineering (ICEBE), Shanghai, China.10.1109/ICEBE.2017.34 ↗
6. Blockchain for Secure and Efficient Data Sharing in Vehicular Edge Computing and Networks10.1109/JIOT.2018.2875542 ↗
7. Hatim, S.M., Elias, S.J., Ali, R.M., Jasmis, J., Aziz, A.A., and Mansor, S. (2020, January 1–3). Blockchain-based internet of vehicles (biov): An approach towards smart cities development. Proceedings of the 2020 5th IEEE International Conference on Recent Advances and Innovations in Engineering (ICRAIE), Jaipur, India.10.1109/ICRAIE51050.2020.9358355 ↗
8. Xia, Q., Sifah, E.B., Smahi, A., Amofa, S., and Zhang, X. (2017). BBDS: Blockchain-Based Data Sharing for Electronic Medical Records in Cloud Environments. Information, 8.10.3390/info8020044 ↗
9. Azaria, A., Ekblaw, A., Vieira, T., and Lippman, A. (2016, January 22–24). Medrec: Using blockchain for medical data access and permission management. Proceedings of the 2016 2nd International Conference on Open and Big Data (OBD), Vienna, Austria.10.1109/OBD.2016.11 ↗
10. Blockchain technology use cases in healthcare10.1016/bs.adcom.2018.03.006 ↗
11. Agbo, C.C., Mahmoud, Q.H., and Eklund, J.M. (2019). Blockchain technology in healthcare: A systematic review. Healthcare, 7.10.3390/healthcare7020056 ↗
12. Blockchains and Smart Contracts for the Internet of Things10.1109/ACCESS.2016.2566339 ↗
13. Blockchain platform for industrial internet of things10.4236/jsea.2016.910036 ↗
14. Can Blockchain Strengthen the Internet of Things?10.1109/MITP.2017.3051335 ↗
15. Szabo, N. (1997). Formalizing and Securing Relationships on Public Networks. First Monday, 2.10.5210/fm.v2i9.548 ↗
16. Ethereum: A secure decentralised generalised transaction ledger
17. Etherscan (2022, November 20). Total Ether Supply. Available online: https://cn.etherscan.com/stat/supply.
18. Zhao, X., Chen, Z., Chen, X., Wang, Y., and Tang, C. (2017, January 11–13). The DAO attack paradoxes in propositional logic. Proceedings of the 2017 4th International Conference on Systems and Informatics (ICSAI), Hangzhou, China.10.1109/ICSAI.2017.8248566 ↗
19. Praitheeshan, P., Pan, L., and Doss, R. (2020, January 25–27). Security evaluation of smart contract-based on-chain ethereum wallets. Proceedings of the International Conference on Network and System Security, Melbourne, Australia.10.1007/978-3-030-65745-1_2 ↗
20. Automated market makers and decentralized exchanges: A DeFi primer10.1186/s40854-021-00314-5 ↗
21. Luu, L., Chu, D.H., Olickel, H., Saxena, P., and Hobor, A. (2016, January 24–28). Making smart contracts smarter. Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, Vienna, Austria.10.1145/2976749.2978309 ↗
22. Nikolić, I., Kolluri, A., Sergey, I., Saxena, P., and Hobor, A. (2018, January 3–7). Finding the greedy, prodigal, and suicidal contracts at scale. Proceedings of the 34th Annual Computer Security Applications Conference, San Juan, PR, USA.10.1145/3274694.3274743 ↗
23. Torres, C.F., Schütte, J., and State, R. (2018, January 3–7). Osiris: Hunting for integer bugs in ethereum smart contracts. Proceedings of the 34th Annual Computer Security Applications Conference, San Juan, PR, USA.10.1145/3274694.3274737 ↗
24. Jiang, B., Liu, Y., and Chan, W.K. (2018, January 3–7). Contractfuzzer: Fuzzing smart contracts for vulnerability detection. Proceedings of the 2018 33rd IEEE/ACM International Conference on Automated Software Engineering (ASE), Montpellier, France.10.1145/3238147.3238177 ↗
25. Gao, J., Liu, H., Liu, C., Li, Q., Guan, Z., and Chen, Z. (2019, January 25–31). Easyflow: Keep ethereum away from overflow. Proceedings of the 2019 IEEE/ACM 41st International Conference on Software Engineering: Companion Proceedings (ICSE-Companion), Montréal, QC, Canada.10.1109/ICSE-Companion.2019.00029 ↗
26. Tann, W.J.W., Han, X.J., Gupta, S.S., and Ong, Y.S. (2018). Towards safer smart contracts: A sequence learning approach to detecting security threats. arXiv.
27. Towards Automated Reentrancy Detection for Smart Contracts Based on Sequential Models10.1109/ACCESS.2020.2969429 ↗
28. Zhuang, Y., Liu, Z., Qian, P., Liu, Q., Wang, X., and He, Q. (2020, January 7–15). Smart Contract Vulnerability Detection using Graph Neural Network. Proceedings of the International Joint Conferences on Artificial Intelligence Organization (IJCAI), Online.10.24963/ijcai.2020/454 ↗
29. A Survey on Security and Privacy Issues of Bitcoin10.1109/COMST.2018.2842460 ↗
30. A next-generation smart contract and decentralized application platform
31. EOS: An Architectural, Performance, and Economic Analysis
32. Elrom, E. (2019). Neo blockchain and smart contracts. The Blockchain Developer, Apress.10.1007/978-1-4842-4847-8 ↗
33. Cachin, C. (2016, January 25). Architecture of the hyperledger blockchain fabric. Proceedings of the Workshop on Distributed Cryptocurrencies and Consensus Ledgers, Chicago, IL, USA.
34. Dannen, C. (2017). Introducing Ethereum and Solidity, Apress.10.1007/978-1-4842-2535-6 ↗
35. Atzei, N., Bartoletti, M., and Cimoli, T. (2017, January 24–25). A survey of attacks on ethereum smart contracts (sok). Proceedings of the International Conference on Principles of Security and Trust, Uppsala, Sweden.10.1007/978-3-662-54455-6_8 ↗
36. Dika, A. (2017). Ethereum Smart Contracts: Security Vulnerabilities and Security Tools. [Master’s Thesis, NTNU].
37. Defects and vulnerabilities in smart contracts, a classification using the NIST bugs framework10.2991/ijndc.k.190710.003 ↗
38. Symbolic execution and program testing10.1145/360248.360252 ↗
39. Tsankov, P., Dan, A., Drachsler-Cohen, D., Gervais, A., Buenzli, F., and Vechev, M. (2018, January 15–19). Securify: Practical security analysis of smart contracts. Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security, Toronto, ON, Canada.10.1145/3243734.3243780 ↗
40. Feist, J., Grieco, G., and Groce, A. (2019, January 27). Slither: A static analysis framework for smart contracts. Proceedings of the 2019 IEEE/ACM 2nd International Workshop on Emerging Trends in Software Engineering for Blockchain (WETSEB), Montreal, QC, Canada.10.1109/WETSEB.2019.00008 ↗
41. He, J., Balunović, M., Ambroladze, N., Tsankov, P., and Vechev, M. (2019, January 11–15). Learning to fuzz from symbolic execution with application to smart contracts. Proceedings of the 2019 ACM SIGSAC Conference on Computer and Communications Security, London, UK.10.1145/3319535.3363230 ↗
42. Nguyen, T.D., Pham, L.H., Sun, J., Lin, Y., and Minh, Q.T. (July, January 27). sfuzz: An efficient adaptive fuzzer for solidity smart contracts. Proceedings of the ACM/IEEE 42nd International Conference on Software Engineering, Seoul, Republic of Korea.
43. Bai, X., Cheng, Z., Duan, Z., and Hu, K. (2018, January 8–10). Formal modeling and verification of smart contracts. Proceedings of the 2018 7th International Conference on Software and Computer Applications, Kuantan, Malaysia.10.1145/3185089.3185138 ↗
44. Amani, S., Bégel, M., Bortin, M., and Staples, M. (2018, January 8–9). Towards verifying ethereum smart contract bytecode in Isabelle/HOL. Proceedings of the 7th ACM SIGPLAN International Conference on Certified Programs and Proofs, Los Angeles, CA, USA.10.1145/3167084 ↗
45. Hildenbrandt, E., Saxena, M., Rodrigues, N., Zhu, X., Daian, P., Guth, D., Moore, B., Park, D., Zhang, Y., and Stefanescu, A. (2018, January 9–12). Kevm: A complete formal semantics of the ethereum virtual machine. Proceedings of the 2018 IEEE 31st Computer Security Foundations Symposium (CSF), Oxford, UK.10.1109/CSF.2018.00022 ↗
46. Bhargavan, K., Delignat-Lavaud, A., Fournet, C., Gollamudi, A., Gonthier, G., Kobeissi, N., Kulatova, N., Rastogi, A., Sibut-Pinote, T., and Swamy, N. (2016, January 24). Formal verification of smart contracts: Short paper. Proceedings of the 2016 ACM Workshop on Programming Languages and Analysis for Security, Vienna, Austria.10.1145/2993600.2993611 ↗
47. Permenev, A., Dimitrov, D., Tsankov, P., Drachsler-Cohen, D., and Vechev, M. (2020, January 18–21). Verx: Safety verification of smart contracts. Proceedings of the 2020 IEEE Symposium on Security and Privacy (SP), San Francisco, CA, USA.10.1109/SP40000.2020.00024 ↗
48. Tikhomirov, S., Voskresenskaya, E., Ivanitskiy, I., Takhaviev, R., Marchenko, E., and Alexandrov, Y. (June, January 27). Smartcheck: Static analysis of ethereum smart contracts. Proceedings of the 1st International Workshop on Emerging Trends in Software Engineering for Blockchain, Gothenburg, Sweden.
49. Yu, X., Zhao, H., Hou, B., Ying, Z., and Wu, B. (2021, January 18–22). DeeSCVHunter: A Deep Learning-Based Framework for Smart Contract Vulnerability Detection. Proceedings of the 2021 International Joint Conference on Neural Networks (IJCNN), Shenzhen, China.10.1109/IJCNN52387.2021.9534324 ↗
50. Huang, T.T.H.D. (2018). Hunting the ethereum smart contract: Color-inspired inspection of potential attacks. arXiv.
51. Deep learning-based malicious smart contract detection scheme for internet of things environment10.1016/j.compeleceng.2021.107583 ↗
52. SySeVR: A Framework for Using Deep Learning to Detect Software Vulnerabilities10.1109/TDSC.2021.3051525 ↗
53. Mikolov, T., Chen, K., Corrado, G., and Dean, J. (2013). Efficient estimation of word representations in vector space. arXiv.
54. Niu, Y., Xie, R., Liu, Z., and Sun, M. (August, January 30). Improved word representation learning with sememes. Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics, Vancouver, BC, Canada.
55. Mikolov, T., Karafiát, M., Burget, L., Cernocký, J., and Khudanpur, S. (2010, January 26–30). Recurrent neural network based language model. Proceedings of the Interspeech, Chiba, Japan.10.21437/Interspeech.2010-343 ↗
56. Long short-term memory10.1162/neco.1997.9.8.1735 ↗
57. Chung, J., Gulcehre, C., Cho, K.H., and Bengio, Y. (2014). Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv.
58. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, Ł., and Polosukhin, I. (2017). Attention is all you need. Advances in Neural Information Processing Systems, Morgan Kaufmann.
59. Durieux, T., Ferreira, J.F., Abreu, R., and Cruz, P. (July, January 27). Empirical review of automated analysis tools on 47,587 Ethereum smart contracts. Proceedings of the ACM/IEEE 42nd International Conference on Software Engineering, Seoul, Republic of Korea.