SmartReco: Detecting Read-Only Reentrancy via Fine-Grained Cross-DApp Analysis

Jingwen Zhang, Zibin Zheng, Yuhong Nan, Mingxi Ye, Kaiwen Ning, Yu Zhang, Weizhe Zhang · DOI

Abstract

Read-Only Reentrancy (ROR) is a sophisticated cross-DApp vulnerability that has resulted in over $30 million in losses within the decentralized finance (DeFi) ecosystem. Traditional security tools often fail to detect ROR due to "boundary blindness" and siloed analysis of individual contracts. This paper presents SmartReco, a novel detection framework that combines fine-grained static analysis with multi-function fuzzing powered by on-chain data. SmartReco achieves a precision of 88.64% and has successfully identified 43 previously unknown ROR vulnerabilities in popular DApps, demonstrating its effectiveness in securing complex cross-contract interactions.

Introduction: The Read-Only Reentrancy Threat

While traditional reentrancy attacks are well-understood and often mitigated by reentrancy guards, Read-Only Reentrancy (ROR) exploits a more subtle architectural gap. In an ROR attack, an adversary manipulates the state of an "entry" DApp and then invokes a "victim" DApp while the state is inconsistent. Because the victim function only performs read operations—such as an oracle checking a price—developers frequently omit security guards, assuming these operations are inherently safe.

Overview of a Read-Only Reentrancy attack involving an entry DApp and a victim DApp.

As shown in Figure 1, the attacker triggers a state change in the Vault (entry DApp) and, before the state is finalized, calls a function in the Pool (victim DApp) which relies on the inconsistent state via an Oracle. Existing detection tools struggle with ROR because they cannot accurately identify DApp boundaries, lack cross-DApp context, and face a massive search space when considering all possible function combinations.

The SmartReco Framework

To address these challenges, SmartReco implements a three-stage pipeline designed to bridge the gap between static code analysis and dynamic execution.

The SmartReco pipeline: from DApp boundary identification to read-only reentrancy verification.

1. DApp Boundary Identification

SmartReco uses a heuristic-based algorithm to determine which contracts belong to a specific DApp. Instead of relying on potentially outdated third-party APIs, it traces the "builders" (creators) of contracts. This approach accurately groups contracts that interact as a single functional unit.

2. Cross-DApp Static Analysis

The framework performs fine-grained static analysis to locate potential entry points. It prioritizes functions based on an "Importance" metric, which considers how frequently a function reads or writes state based on historical data. To manage the search space, SmartReco applies pruning rules, such as ignoring functions already protected by access controls or existing reentrancy guards.

3. Multi-Function Fuzzing

Once potential entry-victim pairs are identified, SmartReco employs context-aware fuzzing. It uses real-world on-chain transaction data as seeds, replaying and mutating these transactions to attempt to trigger inconsistent state reads across DApps. This method is significantly more efficient than random input generation.

Evaluation and Results

SmartReco was evaluated against a labeled dataset of 45 ROR vulnerabilities and a large-scale dataset of 2,676 smart contracts from popular DApps.

  • Precision and Recall: SmartReco achieved a precision of 88.64% and a recall of 86.67% on the labeled dataset.
  • Comparison with State-of-the-Art: Tools like ityFuzz and Sailfish failed to detect any RORs in the benchmark, highlighting the necessity of SmartReco's cross-DApp approach.
  • Real-World Impact: In wild testing, SmartReco discovered 43 new, unreported ROR vulnerabilities, putting approximately $520,000 USD at risk.
  • Efficiency: By leveraging on-chain data, the framework reduced the number of required executions by nearly 75% compared to baseline "blind" fuzzing methods.

Conclusion

SmartReco demonstrates that the assumption of "read-only safety" is a significant vulnerability in the modern DeFi landscape. By identifying DApp boundaries and utilizing historical transaction data to guide analysis, SmartReco provides a robust solution for detecting complex cross-DApp reentrancy. Future work will focus on expanding language support beyond Solidity and refining gas-sensitivity analysis to further improve detection accuracy.

Summary updated

Abstract

Despite the increasing popularity of Decentralized Applications (DApps), they are suffering from various vulnerabilities that can be exploited by adversaries for profits. Among such vulnerabilities, Read-Only Reentrancy (called ROR in this paper), is an emerging type of vulnerability that arises from the complex interactions between DApps. In the recent three years, attack incidents of ROR have already caused around 30M USD losses to the DApp ecosystem. Existing techniques for vulnerability detection in smart contracts can hardly detect Read-Only Reentrancy attacks, due to the lack of tracking and analyzing the complex interactions between multiple DApps. In this paper, we propose SmartReco, a new framework for detecting Read-Only Reentrancy vulnerability in DApps through a novel combination of static and dynamic analysis (i.e., fuzzing) over smart contracts. The key design behind SmartReco is threefold: (1) SmartReco identifies the boundary between different DApps from the heavy-coupled cross-contract interactions. (2) SmartReco performs fine-grained static analysis to locate points of interest (i.e., entry functions) that may lead to ROR. (3) SmartReco utilizes the on-chain transaction data and performs multi-function fuzzing (i.e., the entry function and victim function) across different DApps to verify the existence of ROR. Our evaluation of a manual-labeled dataset with 45 RORs shows that SmartReco achieves a precision of 88.63% and a recall of 86.36%. In addition, SmartReco successfully detects 43 new RORs from 123 popular DApps. The total assets affected by such RORs reach around 520,000 USD.
BibTeX
@inproceedings{zhang2025smartreco,
  author = {Jingwen Zhang and Zibin Zheng and Yuhong Nan and Mingxi Ye and Kaiwen Ning and Yu Zhang and Weizhe Zhang},
  title = {{SmartReco: Detecting Read-Only Reentrancy via Fine-Grained Cross-DApp Analysis}},
  booktitle = {ICSE},
  year = {2025},
  doi = {10.1109/icse55347.2025.00057},
}
Figure