Decoupling Reentrancy Protection from Smart Contract Implementation Logic

Shashank Joshi, Wojciech Golab · 2026

Read Decoupling Reentrancy Protection from Smart Contract Implementation Logic by Shashank Joshi, Wojciech Golab (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-25207.txt.

Introduction

Shashank Joshi and Wojciech Golab separate reentrancy protection from smart contract logic by moving it into the proxy layer. Reentrancy attacks drained around 80 million dollars from decentralized apps last year. Their Sentinel proxy intercepts every call to the implementation contract. A dual-mode design pairs a gas-optimized internal guard with an external lock registry for cross-contract attacks. On 70 vulnerable contracts it reaches full coverage across four attack categories, beating existing solutions by over 40 percent.

Catalog record

CREATORShashank Joshi, Wojciech Golab
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE57237
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2605.25207

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Decoupling Reentrancy Protection from Smart Contract Implementation Logic Shashank Joshi, Wojciech Golab Abstract Recently, DApps (Decentralized Applications) have witnessed exponential growth in their popularity across various sectors. Despite their seemingly robust inherent design, they suffer from a variety of vulnerabilities, which in turn can be exploited by an attack vector for gains. Among such vulnerabilities, reentrancy attacks are a persistent concern, with nefarious actors siphoning around 80M USD from the DApp ecosystem last year, leveraging the complex interaction associated with DApp and EVM’s (Ethereum Virtual Machine) message-passing semantics during inter-contract interaction. Existing research primarily focuses more on the detection of the reentrancy vulnerability and heavily relies on the existing patterns of attacks to identify the potential vulnerability and still fails to provide a precise solution to eliminate that loophole. Similarly, traditional reentrancy guards are ineffective for all the variations of reentrancy attacks, and the security guarantees are susceptible to the complexity of the interactions of the DApps. In this paper, we introduce a novel proxy-based approach designed to mitigate reentrancy vulnerabilities in smart contracts in a type-agnostic way. Unlike traditional reentrancy guards, our proposed solution integrates reentrancy logic directly into the proxy layer, intercepting all calls to the underlying implementation contract or set of contracts. Key features include a dual-mode operational system, offering both a gas-optimized internal guard and a high-security external lock registry for cross-contract reentrancy prevention. Furthermore, the proxy intelligently handles static calls, allowing for safe, non-blocking view-function execution while also protecting the implementation contract from ROR (Read Only Reentrancy) attacks. The intricate technicalities of the proposed proxy-based system, its implementation, and its application against reentrancy vulnerabilities are discussed within the scope of this paper. Through a rigorous analysis of its security coverage over existing solutions using a dataset of 70 vulnerable smart contracts, Sentinel achieves a 40% higher success rate than existing methods, demonstrating superior coverage across four major reentrancy attack categories compared to existing solutions. I Introduction Blockchain technology [ 34 , 35 ] has rapidly evolved, attracting widespread attention from government agencies, financial institutions, and tech companies [ 9 ] . What began as the foundational layer for Bitcoin [ 24 ] has since advanced into the Ethereum-driven 2.0 era [ 5 ] , enabling the creation and deployment of smart contracts—self-executing code that automates agreement enforcement based on predefined conditions [ 23 , 2 ] . These smart contracts now underpin a wide range of decentralized applications (DApps), playing critical roles in financial systems, supply chains, and beyond, as evidenced by platforms like GSENetwork and Jingdong’s blockchain implementations [ 18 , 29 ] . With the rapid proliferation of decentralized applications (DApps) and the burgeoning value locked in smart contracts have amplified the criticality of smart contract security. Among the most insidious and historically damaging vulnerabilities is the reentrancy attack. Reentrancy is one of the vulnerabilities of Ethereum Virtual Machine (EVM) [ 15 ] inter-contract semantics, where an external call to an untrusted contract is made before the calling contract’s state variables are updated, allowing the untrusted contract to leverage this state inconsistency for repeated, unauthorized interactions. Several existing research pieces have demonstrated that a significant fraction of smart contracts deployed on the Ethereum blockchain exhibit programming errors, rendering them susceptible to potential reentrancy attacks [ 16 , 25 ] . This becomes starkly evident from a series of infamous attacks, such as the C.R.E.A.M. Finance attack, the DAO attack, the Fei-Rari attack, the Parity Wallet hack, etc., each resulting in millions of dollars in financial losses [ 38 ] . To address the threat of reentrancy attacks, current mitigation efforts encompass a range of solutions, including the introduction of safe code patterns, formal verification, migration towards safer programming languages, and symbolic execution. However, the significant majority of these efforts are concentrated towards identifying the potential vulnerabilities upfront in the development phase (or pre-deployment phase). Most of these detection tools [ 3 , 11 , 33 , 31 ] depend on the intermediate representation of vulnerable contracts and attack patterns to capture a viable attack path. However, this methodology results in suboptimal detection in more complex attack scenarios due to its restricted scope and rigid attack pattern design. Crucially, while these detection frameworks are valuable, they often fall short of providing concrete, deployable solutions to completely eliminate the identified loopholes, leaving a critical gap in the mitigation lifecycle. And addressing the vulnerabilities post-deployment is particularly challenging due to the following reasons: 1. Immutable nature of smart contracts 2. Anonymity of the owner 3. Lack of coverage in offline static analysis and thus potential susceptibility to missing unknown run-time attack patterns. Furthermore, while there is a lack of reentrancy guards capable of thwarting reentrancy attacks (rather than merely detecting them), traditional reentrancy guards [ 27 ] are typically limited in their scope and static in their application. Simple lock-based implementations, while preventing basic reentrancy, can inadvertently hamper the legitimate logic of the contract itself by overly restricting execution flows. Their effectiveness is highly contingent on meticulous implementation, and they become vulnerable if the attack path bypasses these existing, localized protections. Moreover, handling reentrancy across multiple related contracts or intelligently differentiating between malicious reentrant calls and legitimate static calls (which, despite their read-only nature, can still be part of a reentrancy chain if not properly accounted for) remains a complex and often unaddressed problem for standard implementations. In this paper, we introduce Sentinel, a novel proxy-centric approach designed to comprehensively detect and deter reentrancy attacks. Unlike its conventional counterparts that reside within the application logic, Sentinel integrates reentrancy protection directly into the proxy layer of a potentially vulnerable contract. This strategic placement ensures that all calls to the underlying implementation contract are intercepted and protected before execution, inherently providing resilience to contract upgrades. The main contributions of this article are summarized as follows: We provide a mathematical definition of reentrancy, precisely characterizing the vulnerability in terms of system states, execution traces, and critical state violations. This formalization offers an unambiguous foundation for analyzing and verifying reentrancy properties, moving beyond heuristic descriptions to enable more precise security reasoning and reentrancy guard design requirements. • We propose a dual-mode operational system, featuring a gas-optimized internal guard for efficient single-contract protection and a high-security external lock registry for robust, cross-contract reentrancy prevention. This architecture effectively defends against single-function, cross-function, and cross-contract reentrancy attacks. • Our solution extends its protective scope to include view functions, specifically in the context of staticcall. A specialized check within the proxy detects and prevents ROR attacks, a subtle yet exploitable form of reentrancy, while simultaneously allowing legitimate read-only operations to proceed without unnecessary blocking. • Our solution is engineered to be upgrade-proof. Upgrades or modifications to the smart contract protocol are confined to the implementation part of the contract. • We also conduct a rigorous empirical evaluation of the Sentinel against a diverse dataset of 70 known vulnerable smart contracts. • Our analysis includes a gas cost assessment and demonstrates superior security coverage across four major reentrancy attack categories compared to existing state-of-the-art mitigation techniques. Meanwhile, we also analyze the reasons and critical flaws associated with other reentrancy guards that rendered them ineffective against sophisticated reentrancy attacks. The remainder of this paper is organized

Read the complete text