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

Zhenguang Liu, Peng Qian, Jiaxu Yang, Lingfeng Liu, Xiaojun Xu, Qinming He, Xiaosong Zhang

Introduction

Smart contracts on platforms like Ethereum manage billions of dollars in digital assets, making them high-value targets for malicious actors. While automated testing through fuzzing—a process of providing random inputs to trigger crashes or bugs—has become a standard security practice, traditional fuzzers often struggle with the unique architecture of the Ethereum Virtual Machine (EVM). This paper introduces IR-Fuzz, a novel framework designed to overcome the limitations of state-of-the-art fuzzers by focusing on how functions are ordered and which code paths are prioritized.

The Challenges of Smart Contract Fuzzing

Current smart contract fuzzers face three primary hurdles that limit their effectiveness:

  1. Shallow State Exploration: Most fuzzers begin testing from a contract's initial state. However, many vulnerabilities only manifest after a specific sequence of transactions has moved the contract into a "deep" state.
  2. Data Dependency Blindness: Fuzzers often invoke functions in a random or brute-force order. This ignores the reality that one function (e.g., an initialization or deposit function) often needs to write to a global variable before another function (e.g., a withdrawal) can trigger a specific logic branch or bug.
  3. Resource Mismanagement: Traditional tools often treat every branch of code as equally important. This leads to wasted computational power on "normal" or trivial code paths, while rare, complex, or inherently risky branches—where vulnerabilities typically hide—remain under-explored.

Methodology: The IR-Fuzz Framework

IR-Fuzz addresses these challenges through three integrated components designed to make fuzzing more intentional and state-aware.

Invocation Ordering and Prolongation

Rather than relying on random execution, IR-Fuzz performs a data-flow analysis of the contract. If the system detects that Function A writes to a global variable that Function B reads, it prioritizes calling A before B. Furthermore, the framework utilizes "prolongation," repeating specific sequences (e.g., A-B-A-B) to explore complex state transitions that simple, single-pass sequences might miss.

Seed Optimization via Branch Distance

To navigate past strict conditional statements (such as if x == 1337), IR-Fuzz employs a "branch distance" metric. This mathematical approach measures how close a specific test input came to satisfying a condition. By treating the search for new branches as a guided optimization problem rather than a blind search, IR-Fuzz can iteratively evolve its input "seeds" to penetrate deeper into the contract logic.

Importance-Aware Energy Allocation

IR-Fuzz implements a sophisticated branch search algorithm to identify "important" code. It defines importance based on two criteria:

  • Rarity: Branches that are nested behind multiple conditions and are statistically less likely to be hit.
  • Risk: Branches containing operations known to be dangerous, such as call.value or self-destruct mechanisms.

The framework then allocates more "energy"—meaning more mutation attempts and CPU cycles—to these high-value targets, ensuring that the most critical parts of the contract receive the most scrutiny.

Experimental Evaluation

The researchers evaluated IR-Fuzz against a massive dataset of 12,115 real-world Ethereum smart contracts crawled from Etherscan. The tool was benchmarked against seven prominent baselines, including static analysis tools like Mythril and Securify, and state-of-the-art fuzzers like sFuzz and ConFuzzius.

Key Results

  • Superior Coverage: IR-Fuzz achieved 28% higher branch coverage than existing fuzzers. On smaller, less complex contracts, it reached an average coverage of 90.1%.
  • Enhanced Bug Detection: The tool identified 485 vulnerabilities across the dataset. This performance was approximately 4.7 times more effective than the runner-up fuzzer, sFuzz.
  • Efficiency: Despite the added complexity of data-flow analysis and branch distance calculations, IR-Fuzz maintained high performance, generating an average of 350 test cases per second.
  • Novel Discoveries: IR-Fuzz successfully identified a previously under-reported vulnerability type: Dangerous Ether Strict Equality, which many automated tools fail to detect.

Conclusion and Future Work

IR-Fuzz demonstrates that smart contract fuzzing is most effective when it treats the contract as a state machine rather than a collection of isolated functions. By intelligently ordering transactions and focusing resources on rare or risky branches, IR-Fuzz significantly outperforms existing tools in both coverage and vulnerability detection.

Future research will focus on reducing the computational overhead associated with data-dependency analysis in very large contracts and improving mutation intelligence. By moving beyond bit-level mutations toward type-aware data generation, the researchers aim to satisfy even more complex, multi-variable constraints in the future.

Summary updated

BibTeX
@article{liu2023rethinking,
  author = {Zhenguang Liu and Peng Qian and Jiaxu Yang and Lingfeng Liu and Xiaojun Xu and Qinming He and Xiaosong Zhang},
  title = {{Rethinking Smart Contract Fuzzing: Fuzzing With Invocation Ordering and Important Branch Revisiting}},
  journal = {IEEE Trans. Inf. Forensics Secur.},
  year = {2023},
  doi = {10.1109/tifs.2023.3237370},
}
Figure