Executive Summary: In April 2026, a novel exploit targeting ERC-4337 account-abstraction wallets drained millions in USD from DeFi protocols by exploiting reentrancy vulnerabilities in paymaster contracts. Attackers leveraged malicious smart contracts to repeatedly withdraw funds before state changes were finalized, bypassing traditional security measures. This incident underscores the urgent need for reentrancy guards and formal verification in account-abstraction systems.
ERC-4337, finalized in 2023, introduced account abstraction to Ethereum by enabling smart contract wallets to manage user funds with programmable logic. Unlike EOAs (Externally Owned Accounts), these wallets support features like batch transactions, social recovery, and gas sponsorship—via paymasters. Paymasters allow third-party entities to cover gas fees, enabling use cases like sponsored transactions and subsidized onboarding.
However, the flexibility of paymasters also introduced new attack surfaces. A paymaster contract typically verifies a user’s eligibility for sponsorship before executing a transaction. If this logic is not reentrancy-safe, an attacker can craft a malicious paymaster call that recursively triggers further withdrawals before the initial state change (e.g., balance update) is committed.
The attack unfolded in three phases:
validatePaymasterUserOp() function.This recursive pattern drained liquidity pools faster than state changes could be recorded on-chain, exploiting the asynchronous nature of Ethereum’s mempool and the lack of atomicity in multi-step operations.
Most DeFi protocols in 2026 still relied on:
The exploit demonstrated that reentrancy risks in account-abstraction systems are not isolated to wallet contracts but extend to any external contract interfacing with UserOperations—especially paymasters.
The attack affected over $12 million in assets across:
Notably, the exploit did not require private key compromise—only a carefully crafted UserOperation and timing manipulation. This shifted responsibility from users to protocol developers, emphasizing the need for secure-by-design architectures.
The 2026 exploit accelerated a paradigm shift in DeFi security:
IReentrancyGuard interface, mandating reentrancy checks in all paymaster contracts.JupiterSwap, a leading DEX, lost $4.2M when its paymaster contract—intended to sponsor gas for new users—was compromised. The attacker crafted a UserOperation that triggered the paymaster’s postOp() function to recursively call a withdrawal function in the pool contract. Despite using OpenZeppelin’s reentrancy guard on the main contract, the paymaster was not protected, allowing the drain. The exploit was halted only after the team manually paused the paymaster and redeployed with hardened logic.
The 2026 DeFi exploit exposed a critical flaw in the design and deployment of ERC-4337 paymasters. While account abstraction promised greater usability and inclusivity, its integration with complex financial systems demanded stronger security primitives. The lesson is clear: flexibility must not outpace safety. As ERC-4337 evolves, reentrancy protection must be non-negotiable, and all external contracts interfacing with UserOperations must undergo rigorous formal verification.
For the DeFi ecosystem to mature, security must be embedded at the protocol level—not bolted on in response to incidents.
Q1: What is a paymaster in ERC-4337?
A paymaster is a smart contract that sponsors gas fees for UserOperations, enabling features like sponsored transactions and gasless onboarding. It acts as an intermediary between the user and the bundler.
Q2: How can reentrancy occur in a paymaster contract?
If a paymaster calls an external contract (e.g., a DeFi protocol) during the execution of a UserOperation, and that contract calls back into the paymaster before the initial call completes, reentrancy can occur. Without a reentrancy guard, this can lead to repeated withdrawals before balances are updated.
Q3: What is the best defense against this exploit?
The most effective defenses are: (1) applying reentrancy guards (<