Rethinking Smart Contract Fuzzing: Fuzzing With Invocation Ordering and Important Branch Revisiting

被引:38
|
作者
Liu, Zhenguang [1 ]
Qian, Peng [2 ]
Yang, Jiaxu [3 ]
Liu, Lingfeng [3 ]
Xu, Xiaojun [3 ]
He, Qinming [2 ]
Zhang, Xiaosong [4 ]
机构
[1] Zhejiang Univ, Sch Cyber Sci & Technol, Hangzhou 310018, Peoples R China
[2] Zhejiang Univ, Coll Comp Sci & Technol, Hangzhou 310018, Peoples R China
[3] Zhejiang Gongshang Univ, Sch Comp & Informat Engn, Hangzhou 310018, Peoples R China
[4] Univ Elect Sci & Technol China, Ctr Cyber Secur, Chengdu 611731, Peoples R China
关键词
Fuzzing; smart contract; vulnerability detection; blockchain; sequence generation; seed evolution; BLOCKCHAIN;
D O I
10.1109/TIFS.2023.3237370
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
Blockchain smart contracts have given rise to a variety of interesting and compelling applications and emerged as a revolutionary force for the Internet. Smart contracts from various fields now hold over one trillion dollars worth of virtual coins, attracting numerous attacks. Quite a few practitioners have devoted themselves to developing tools for detecting bugs in smart contracts. One line of efforts revolve around static analysis techniques, which heavily suffer from high false positive rates. Another line of works concentrate on fuzzing techniques. Unfortunately, current fuzzing approaches for smart contracts tend to conduct fuzzing starting from the initial state of the contract, which expends too much energy revolving around the initial state of the contract and thus is usually unable to unearth bugs triggered by other states. Moreover, most existing methods treat each branch equally, failing to take care of the branches that are rare or more likely to possess bugs. This might lead to resources wasted on normal branches. In this paper, we try to tackle these challenges from three aspects: 1) generating function invocation sequences, we explicitly consider data dependencies between functions to facilitate exploring richer states. We further prolong a function invocation sequence S-1 by appending a new sequence $\mathcal S-2, so that the appended sequence S-2 can start fuzzing from states that are different from the initial state; 2) we incorporate a branch distance-based measure to evolve test cases iteratively towards a target branch; 3) we engage a branch search algorithm to discover rare and vulnerable branches, and design an energy allocation mechanism to take care of exercising these crucial branches. We implement IR-Fuzz and extensively evaluate it over 12K real-world contracts. Empirical results show that: (i) IR-Fuzz achieves 28% higher branch coverage than state-of-the-art fuzzing approaches, (ii) IR-Fuzz detects more vulnerabilities and increases the average accuracy of vulnerability detection by 7% over current methods, and (iii) IR-Fuzz is fast, generating an average of 350 test cases per second. Our implementation and dataset are released at https://github.com/Messi-Q/IR-Fuzz, hoping to facilitate future research.
引用
收藏
页码:1237 / 1251
页数:15
相关论文
共 13 条
  • [1] Towards Smart Contract Fuzzing on GPUs
    Chen, Weimin
    Luo, Xiapu
    Cai, Haipeng
    Wang, Haoyu
    45TH IEEE SYMPOSIUM ON SECURITY AND PRIVACY, SP 2024, 2024, : 2255 - 2272
  • [2] Correctness Detection of Smart Contract Based on Fuzzing
    Wang, Jiacheng
    Jiang, Jiajia
    Zhao, Jiahao
    Zhang, Yushu
    Wang, Liangmin
    Computer Engineering and Applications, 2024, 60 (05) : 307 - 320
  • [3] A Guided Mutation Strategy for Smart Contract Fuzzing
    Ji, Songyan
    Dong, Jian
    Wu, Jin
    Lu, Lishi
    2023 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION, ICSME, 2023, : 282 - 292
  • [4] CrossFuzz: Cross-contract fuzzing for smart contract vulnerability detection
    Yang, Huiwen
    Gu, Xiguo
    Chen, Xiang
    Zheng, Liwei
    Cui, Zhanqi
    SCIENCE OF COMPUTER PROGRAMMING, 2024, 234
  • [5] An Expert Knowledge Generation Model in Smart Contract Vulnerability Fuzzing
    Li, Xing
    2023 IEEE 9TH INTL CONFERENCE ON BIG DATA SECURITY ON CLOUD, BIGDATASECURITY, IEEE INTL CONFERENCE ON HIGH PERFORMANCE AND SMART COMPUTING, HPSC AND IEEE INTL CONFERENCE ON INTELLIGENT DATA AND SECURITY, IDS, 2023, : 51 - 56
  • [6] TokenAuditor: Detecting Manipulation Risk in Token Smart Contract by Fuzzing
    Cao, Mingpei
    Zhang, Yueze
    Feng, Zhenxuan
    Hu, Jiahao
    Zhu, Yuesheng
    2022 IEEE 22ND INTERNATIONAL CONFERENCE ON SOFTWARE QUALITY, RELIABILITY AND SECURITY, QRS, 2022, : 651 - 662
  • [7] echidna-parade: A Tool for Diverse Multicore Smart Contract Fuzzing
    Groce, Alex
    Grieco, Gustavo
    ISSTA '21: PROCEEDINGS OF THE 30TH ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON SOFTWARE TESTING AND ANALYSIS, 2021, : 658 - 661
  • [8] EF(sic)CF: High Performance Smart Contract Fuzzing for Exploit Generation
    Rodler, Michael
    Paassen, David
    Li, Wenting
    Bernhard, Lukas
    Holz, Thorsten
    Karame, Ghassan
    Davi, Lucas
    2023 IEEE 8TH EUROPEAN SYMPOSIUM ON SECURITY AND PRIVACY, EUROS&P, 2023, : 449 - 471
  • [9] sFuzz2.0: Storage-access pattern guided smart contract fuzzing
    Wang, Haoyu
    Wang, Zan
    Liu, Shuang
    Sun, Jun
    Zhao, Yingquan
    Wan, Yan
    Nguyen, Tai D.
    JOURNAL OF SOFTWARE-EVOLUTION AND PROCESS, 2024, 36 (04)
  • [10] SMARTIAN: Enhancing Smart Contract Fuzzing with Static and Dynamic Data-Flow Analyses
    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