SmartOracle: Generating Smart Contract Oracle via Fine-Grained Invariant Detection

被引:0
作者
Su, Jianzhong [1 ,2 ]
Chen, Jiachi [1 ,2 ]
Fang, Zhiyuan [1 ,2 ]
Lin, Xingwei [3 ]
Tang, Yutian [4 ]
Zheng, Zibin [1 ,2 ]
机构
[1] Sun Yat Sen Univ, Sch Software Engn, Zhuhai 519000, Peoples R China
[2] GuangDong Engn Technol Res Ctr Blockchain, Zhuhai 519000, Peoples R China
[3] Zhejiang Univ, Coll Comp Sci & Technol, Hangzhou 310058, Peoples R China
[4] Univ Glasgow, Sch Comp Sci, Glasgow G12 8QQ, Scotland
基金
中国国家自然科学基金; 国家重点研发计划;
关键词
Smart contracts; Blockchains; Security; Detectors; Decentralized applications; Recording; Virtual machines; Usability; Robustness; Research and development; Smart contract; invariant detection; vulnerability detection;
D O I
暂无
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
As decentralized applications (DApps) proliferate, the increased complexity and usage of smart contracts have heightened their susceptibility to security incidents and financial losses. Although various vulnerability detection tools have been developed to mitigate these issues, they often suffer poor performance in detecting vulnerabilities, as they either rely on simplistic and general-purpose oracles that may be inadequate for vulnerability detection, or require user-specified oracles, which are labor-intensive to create. In this paper, we introduce SmartOracle, a dynamic invariant detector that automatically generates fine-grained invariants as application-specific oracles for vulnerability detection. From historical transactions, SmartOracle uses pattern-based detection and advanced inference to construct comprehensive properties, and mines multi-layer likely invariants to accommodate the complicated contract functionalities. After that, SmartOracle identifies smart contract vulnerabilities by hunting the violated invariants in new transactions. In the field of invariant detection, SmartOracle detects 50% more ERC20 invariants than existing dynamic invariant detection and achieves 96% precision rate. Furthermore, we build a dataset that contains vulnerable contracts from real-world security incidents. SmartOracle successfully detects 466 abnormal transactions with an acceptable precision rate 96%, involving 31 vulnerable contracts. The experimental results demonstrate its effectiveness in detecting smart contract vulnerabilities, especially those related to complicated contract functionalities.
引用
收藏
页码:947 / 959
页数:13
相关论文
共 53 条
[1]  
[Anonymous], 2022, Solidity documentation
[2]  
[Anonymous], 2022, ERC-20 Token Standard.
[3]  
[Anonymous], 2022, Ethereum yellow paper: A formal specification of Ethereum, a programmable blockchain
[4]  
Beschastnikh I., 2011, P 19 ACM SIGSOFT S 1, P267, DOI DOI 10.1145/2025113.2025151
[5]  
Bose P, 2022, P IEEE S SECUR PRIV, P161, DOI [10.1109/SP46214.2022.9833721, 10.1109/SP46214.2022.00072]
[6]   TokenScope: Automatically Detecting Inconsistent Behaviors of Cryptocurrency Tokens in Ethereum [J].
Chen, Ting ;
Zhang, Yufei ;
Li, Zihao ;
Luo, Xiapu ;
Wang, Ting ;
Cao, Rong ;
Xiao, Xiuzhuo ;
Zhang, Xiaosong .
PROCEEDINGS OF THE 2019 ACM SIGSAC CONFERENCE ON COMPUTER AND COMMUNICATIONS SECURITY (CCS'19), 2019, :1503-1520
[7]   SMARTIAN: Enhancing Smart Contract Fuzzing with Static and Dynamic Data-Flow Analyses [J].
Choi, Jaeseung ;
Kim, Doyeon ;
Kim, Soomin ;
Grieco, Gustavo ;
Groce, Alex ;
Cha, Sang Kil .
2021 36TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING ASE 2021, 2021, :227-239
[8]  
coindesk, 2020, bzx network hacked
[9]   Towards Automated Safety Vetting of Smart Contracts in Decentralized Applications [J].
Duan, Yue ;
Zhao, Xin ;
Pan, Yu ;
Li, Shucheng ;
Li, Minghao ;
Xu, Fengyuan ;
Zhang, Mu .
PROCEEDINGS OF THE 2022 ACM SIGSAC CONFERENCE ON COMPUTER AND COMMUNICATIONS SECURITY, CCS 2022, 2022, :921-935
[10]   The Daikon system for dynamic detection of likely invariants [J].
Ernst, Michael D. ;
Perkins, Jeff H. ;
Guo, Philip J. ;
McCarnant, Stephen ;
Pacheco, Carlos ;
Tschantz, Matthew S. ;
Xiao, Chen .
SCIENCE OF COMPUTER PROGRAMMING, 2007, 69 (1-3) :35-45