Skip to main content

GAN-Enabled Code Embedding for Reentrant Vulnerabilities Detection

  • Conference paper
  • First Online:
Knowledge Science, Engineering and Management (KSEM 2021)

Part of the book series: Lecture Notes in Computer Science ((LNAI,volume 12817))

Abstract

As one of the key components of blockchain, smart contract is playing a vital role in achieving auto-functions; however, reentrant attacks are threatening the implementation of smart contracts, which limits the adoption of blockchain systems in various scenarios. To address this issue, we propose a reentrant vulnerability detection model based on word embedding, similarity detection, and Generative Adversarial Networks (GAN). Additionally, we provide a new approach for dynamically preventing reentrant attacks. We also implement experiments to evaluate our model and results show our scheme achieves 92% detecting accuracy for reentrant attack detection.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

References

  1. Ashizawa, N., Yanai, N., Cruz, J., Okamura, S.: Eth2Vec: learning contract-wide code representations for vulnerability detection on ethereum smart contracts. In: the 3rd ACM International Symposium on Blockchain and Secure Critical Infrastructure, Hong Kong, China, pp. 47–59 (2021)

    Google Scholar 

  2. Bojanowski, P., Grave, E., Joulin, A., Mikolov, T.: Enriching word vectors with subword information. Trans. Assoc. Comput. Linguist. 5, 135–146 (2017)

    Article  Google Scholar 

  3. Dong, C., Li, Y., Tan, L.: A new approach to prevent reentrant attack in solidity smart contracts. In: Si, X., et al. (eds.) CBCC 2019. CCIS, vol. 1176, pp. 83–103. Springer, Singapore (2020). https://doi.org/10.1007/978-981-15-3278-8_6

    Chapter  Google Scholar 

  4. Gai, K., Qiu, M., Zhao, H., Tao, L., Zong, Z.: Dynamic energy-aware cloudlet-based mobile cloud computing model for green computing. J. Netw. Comput. Appl. 59, 46–54 (2016)

    Article  Google Scholar 

  5. Gai, K., Wu, Y., Zhu, L., Qiu, M., Shen, M.: Privacy-preserving energy trading using consortium blockchain in smart grid. IEEE Trans. Ind. Inf. 15(6), 3548–3558 (2019)

    Article  Google Scholar 

  6. Gai, K., Wu, Y., Zhu, L., Zhang, Z., Qiu, M.: Differential privacy-based blockchain for industrial Internet-of-Things. IEEE Trans. Ind. Inf. 16(6), 4156–4165 (2019)

    Article  Google Scholar 

  7. Gai, K., Guo, J., Zhu, L., Yu, S.: Blockchain meets cloud computing: a survey. IEEE Commun. Surv. Tutor. 22(3), 2009–2030 (2020)

    Article  Google Scholar 

  8. Gao, Z., Jayasundara, V., Jiang, L., Xia, X., Lo, D., Grundy, J.: SmartEmbed: a tool for clone and bug detection in smart contracts through structural code embedding. In: IEEE International Conference on Software Maintenance and Evolution (ICSME) (2019)

    Google Scholar 

  9. Gao, Z., Jiang, L., Xia, X., Lo, D., Grundy, J.: Checking smart contracts with structural code embedding. IEEE Trans. Softw. Eng. PP(99), 1–1 (2020)

    Google Scholar 

  10. Griggs, K.N., Olya, O., Kohlios, C.P., Baccarini, A.N., Howson, E.A., Thaier, H.: Healthcare blockchain system using smart contracts for secure automated remote patient monitoring. J. Med. Syst. 42(7), 130 (2018). https://doi.org/10.1007/s10916-018-0982-x

    Article  Google Scholar 

  11. Luu, L., Chu, D., Olickel, H., Saxena, P., Hobor, A.: Making smart contracts smarter. IACR Cryptol. ePrint Arch. 2016, 633 (2016)

    Google Scholar 

  12. Mikolov, T., Chen, K., Corrado, G., Dean, J.: Efficient estimation of word representations in vector space. Computer Science (2013)

    Google Scholar 

  13. Permenev, A., Dimitrov, D., Tsankov, P., Drachsler-Cohen, D., Vechev, M.: Verx: safety verification of smart contracts. In: IEEE Symposium on Security and Privacy (2020)

    Google Scholar 

  14. Qiu, H., Qiu, M., Memmi, G., Ming, Z., Liu, M.: A dynamic scalable blockchain based communication architecture for IoT. In: Qiu, M. (ed.) SmartBlock 2018. LNCS, vol. 11373, pp. 159–166. Springer, Cham (2018). https://doi.org/10.1007/978-3-030-05764-0_17

    Chapter  Google Scholar 

  15. Qiu, H., et al.: All-or-nothing data protection for ubiquitous communication: challenges and perspectives. Inf. Sci. 502, 434–445 (2019)

    Article  MathSciNet  Google Scholar 

  16. Rodler, M., Li, W., Karame, G., Davi, L.: Sereum: protecting existing smart contracts against re-entrancy attacks. arXiv preprint arXiv:1812.05934 (2018)

  17. Tian, Z., Li, M., Qiu, M., Sun, Y., Su, S.: Block-DEF: A secure digital evidence framework using blockchain. Inf. Sci. 491, 151–165 (2019)

    Article  Google Scholar 

  18. Tsankov, P., Dan, A.M., Drachsler-Cohen, D., Gervais, A., Bünzli, F., Vechev, M.T.: Securify: practical security analysis of smart contracts. In: ACM SIGSAC Conference on Computer and Communications Security (CCS) 2018, Toronto, Canada, pp. 67–82 (2018)

    Google Scholar 

  19. Wang, K., Tao, J., Zhu, J., Ye, Z., Qiu, B., Xu, J.: Compressed sensing MRI reconstruction using generative adversarial network with enhanced antagonism. In: 12th International Conference on Intelligent Computation Technology and Automation, pp. 282–285 (2019)

    Google Scholar 

  20. Xin, R., Zhang, J., Shao, Y.: Complex network classification with convolutional neural network. Tsinghua Sci. Technol. 25(4), 447–457 (2020)

    Article  Google Scholar 

  21. Zhuang, Y., et al.: Smart contract vulnerability detection using graph neural network. In: IJCAI-PRICAI-20 (2020)

    Google Scholar 

Download references

Acknowledgement

This work is partially supported by National Natural Science Foundation of China (Grant No. 61972034), Natural Science Foundation of Beijing Municipality (Grant No. 4202068), Natural Science Foundation of Shandong Province (Grant No. ZR2019ZD10, ZR2020ZD01).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Keke Gai .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Zhao, H., Su, P., Wei, Y., Gai, K., Qiu, M. (2021). GAN-Enabled Code Embedding for Reentrant Vulnerabilities Detection. In: Qiu, H., Zhang, C., Fei, Z., Qiu, M., Kung, SY. (eds) Knowledge Science, Engineering and Management. KSEM 2021. Lecture Notes in Computer Science(), vol 12817. Springer, Cham. https://doi.org/10.1007/978-3-030-82153-1_48

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-82153-1_48

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-82152-4

  • Online ISBN: 978-3-030-82153-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics