TL;DR
ItyFuzz is a novel, snapshot-based fuzzer for smart contracts that replaces slow transaction re-execution with instant "time travel" between states. By utilizing specialized dataflow and comparison "waypoints" to prioritize interesting states, it achieves second-level response times, making real-time on-chain auditing and exploit prevention a reality.
What Problem Does This Paper Address?
Smart contracts are stateful programs; their behavior depends not just on the current input, but on the entire history of transactions stored on the blockchain. Traditional fuzzers test these contracts by generating long sequences of transactions. However, to test a new transaction at the end of a sequence, the fuzzer must re-execute every preceding transaction from scratch.
As sequences grow, this re-execution overhead becomes a massive bottleneck—often consuming over 90% of total fuzzing time. This slowness makes it impossible to perform "on-chain auditing," where a fuzzer needs to analyze the live, ever-changing state of the blockchain to catch an attacker's exploit before it's finalized.
Methods
The authors introduce ItyFuzz, which shifts the paradigm from mutating transaction sequences to mutating snapshots of states.
- Snapshot-Based Fuzzing: Instead of re-playing transactions, ItyFuzz stores interesting intermediate states (snapshots). It can "time travel" to any previous state with constant complexity ($O(1)$), drastically reducing overhead.
- Dataflow Waypoints: To avoid storing every single state (which would crash the system), ItyFuzz uses a dataflow mechanism. It tracks which memory locations were "loaded" (read) in the past. If a new transaction "stores" (writes) a unique value to one of those locations, the resulting state is deemed "interesting" for future exploration.
- Comparison Waypoints: This mechanism prunes the state space by favoring states that move the program closer to satisfying a conditional branch (e.g., getting a counter closer to a target value). It uses a "voting" system to prioritize states that have a higher likelihood of uncovering new code paths.
- On-Chain Integration: Built using the Rust-based
revm(Ethereum Virtual Machine) andLibAFL, ItyFuzz can pull live state from any blockchain supporting the Geth client, allowing it to fuzz contracts in their actual production environment.
Datasets
The researchers evaluated ItyFuzz using:
- B1: 57 smart contracts supporting the ERC20 (token) standard.
- B2 & B3: 72 and 500 smart contracts, respectively, crawled directly from the Ethereum mainnet.
- Real-World Exploits: A collection of 42 previously exploited DeFi projects.
- Large-Scale Wild Test: 45,000 smart contract projects (comprising over 150k individual contracts) from Binance Smart Chain and Ethereum.
Key Insights and Ideas
- Re-execution is the Enemy: The study confirms that in state-of-the-art fuzzers like SMARTIAN, re-execution overhead grows exponentially with sequence length, stifling deep state exploration.
- State "Interestingness" Matters: Just as fuzzers track "interesting" inputs, they must track "interesting" states. ItyFuzz proves that feedback based on memory access patterns (dataflow) is a powerful proxy for future program reachability.
- The "Development vs. Production" Gap: The authors show that some vulnerabilities (like the $190M Nomad Bridge hack) are invisible in local development environments because they depend on specific initialization states only present on the live chain. This highlights the necessity of on-chain fuzzing.
Key Results
- Speed: ItyFuzz reaches near-total instruction coverage on the B1 dataset in just 10 seconds, whereas the previous state-of-the-art (SMARTIAN) could not reach the same level even after a minute.
- Vulnerability Detection: ItyFuzz identified concrete exploits for 36 out of 42 real-world projects with an average time of only 13.8 seconds.
- Real-Time Auditing: In a retrospective test on the Nomad Bridge hack, ItyFuzz found the vulnerability in 0.3 seconds. For the Team Finance hack, it generated an exploit in 2.2 seconds—significantly faster than the hour-long window developers had to react during the actual attack.
- Financial Impact: In its large-scale crawl, ItyFuzz found vulnerabilities in 21 projects that put over $500k at immediate risk, and identified common bugs in 1,384 other projects holding over $8M.
Limitations and Future Work
- Brute-Force Constraints: ItyFuzz struggles when a contract requires a very specific, large input (like a 160-bit address or a 256-bit cryptographic signature) without any "hints" in the code. The fuzzer cannot easily guess these values.
- Future Direction: The authors suggest that integrating concolic execution (combining symbolic and concrete execution) could help solve these "hard" input constraints that currently require brute force.
- Oracle Dependency: While ItyFuzz is fast, it still requires "oracles" (properties to check) to define what constitutes a bug. Automating the creation of these oracles for complex DeFi logic remains a challenge.
Summary updated