Formal Analysis of Reentrancy Vulnerabilities in Smart Contract Based on CPN

Author:

He Yaqiong1,Dong Hanjie1ORCID,Wu Huaiguang1ORCID,Duan Qianheng2

Affiliation:

1. College of Computer and Communication Engineering, Zhengzhou University of Light Industry, Zhengzhou 450001, China

2. Henan Key Laboratory of Network Cryptography Technology, Zhengzhou 450001, China

Abstract

A smart contract is a special form of computer program that runs on a blockchain and provides a new way to implement financial and business transactions in a conflict-free and transparent environment. In blockchain systems such as Ethereum, smart contracts can handle and autonomously transfer assets of considerable value to other parties. Hence, it is particularly important to ensure that smart contracts function as intended since bugs or vulnerabilities may lead, and indeed have led, to substantial economic losses and erosion of trust for blockchain. While a number of approaches and tools have been developed to find vulnerabilities, formal methods present the highest level of confidence in the security of smart contracts. In this paper, we propose a formal solution to model a smart contract based on colored Petri nets (CPNs). Herein, we focus on the most common type of security bugs in smart contract, i.e., reentrancy bugs, which led to a serious financial loss of around USD 34 million for the Cream Finance project in 2021. We present a hierarchical CPN modelling method to analyze potential security vulnerabilities at the contract’s source code level. Then, modeling analysis methods such as correlation matrix, state space report and state space graph generated via CPN Tools simulation are exploited for formal analysis of smart contracts. The example shows the full state space and wrong path in accordance with our expected results. Finally, the conclusion was verified on the Ethereum network based on the Remix platform.

Funder

Major Public Welfare Projects Foundation of Henan Province

Open Foundation of Henna Key Laboratory Cryptography

Publisher

MDPI AG

Subject

Electrical and Electronic Engineering,Computer Networks and Communications,Hardware and Architecture,Signal Processing,Control and Systems Engineering

Reference49 articles.

1. Bitcoin: A peer-to-peer electronic cash system;Nakamoto;Decentralized Bus. Rev.,2018

2. Blockchain technology: Beyond bitcoin;Crosby;Appl. Innov.,2016

3. A next-generation smart contract and decentralized application platform;Buterin;White Pap.,2014

4. Blass, E.O., and Kerschbaum, F. (2018). European Symposium on Research in Computer Security, Springer.

5. Smart contract development: Challenges and opportunities;Zou;IEEE Trans. Softw. Eng.,2019

Cited by 3 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. Provenance Verification of Smart Contracts: Analysing the Cost of Ensuring Authenticity over the Logic Hosted in Blockchain Networks;Information;2023-12-31

2. Preventing Ethereum Blockchain Re-Entrancy Attacks Using Smart Mutex Lock Sum;2023 4th International Conference on Computation, Automation and Knowledge Management (ICCAKM);2023-12-12

3. Automating the verification of smart contracts in blockchain networks for improving security*;2023 49th Euromicro Conference on Software Engineering and Advanced Applications (SEAA);2023-09-06

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3