Share on XShare on LinkedInShare on Telegram
Security Decisions/ Before launchWeb3 Security

ERC-4337 Security Risks: Paymaster and Bundler Attacks

Account abstraction security goes beyond wallet code. This guide explains ERC-4337’s four trust boundaries (sender, paymaster, bundler, EntryPoint), how paymaster drain and postOp() failures work, why ERC-7562 bans certain opcodes, what the $270K Lumi Finance Sodium exploit revealed, and a checklist for teams running their own smart accounts, paymasters, and bundler infrastructure.

Author
QuillAudits Team
•October 16, 2026
ERC-4337 Security Risks: Paymaster and Bundler Attacks
Share on XShare on LinkedInShare on Telegram

The decision · answer in brief

Account abstraction security goes beyond wallet code. This guide explains ERC-4337’s four trust boundaries (sender, paymaster, bundler, EntryPoint), how paymaster drain and postOp() failures work, why ERC-7562 bans certain opcodes, what the $270K Lumi Finance Sodium exploit revealed, and a checklist for teams running their own smart accounts, paymasters, and bundler infrastructure.

What is Account Abstraction Security? Paymaster & Bundler Risks

Account abstraction security is usually explained as a wallet-code problem: did the smart account validate the right signature, did the module get configured correctly. This post walks through that trust boundary, including a real 2026 exploit, and closes with a checklist for teams running their own smart accounts.

What Is ERC-4337 Account Abstraction Security, and Why Isn't It Just Wallet Code?

ERC-4337 lets a smart contract, not a private key, act as a wallet. Instead of broadcasting a normal transaction, a user signs a UserOperation, a structured object describing what they want to do, and submits it to an alternate mempool rather than the standard Ethereum mempool. From there, a bundler packages one or more UserOperations into a real transaction and sends it to a singleton contract called the EntryPoint, which runs validation, executes the call, and handles payment.

That extra machinery is the point of account abstraction: it's what gives you gas sponsorship, session keys, and social recovery without changing the base protocol. It's also where account abstraction security actually lives, because the paymaster and bundler are trusted off-chain actors sitting between the user's signed intent and the EntryPoint's execution, and each one can misbehave in ways no wallet audit will catch.

How UserOperations Differ From Normal Transactions

A normal Ethereum transaction has one signer, one gas payer, and one execution path, all enforced directly by consensus. A UserOperation splits those roles apart. The sender (the smart account) defines the intended call. An optional paymaster can agree to cover gas instead of the sender. A bundler decides which UserOperations to include and in what order, since there's no native mempool support for them. The EntryPoint contract, defined by ERC-4337, is the only thing all parties agree on, and it runs a two-phase process: a validation phase that checks signatures and funds, then an execution phase that actually runs the call.

That split, sign now, pay and execute later through a third party, is exactly what creates room for drain and censorship attacks that a plain transaction can't have.

The Four Trust Boundaries: Sender, Paymaster, Bundler, EntryPoint

Every ERC-4337 flow has four parties, and account abstraction security is really the sum of the trust assumptions between them:

  • Sender - the smart account contract itself, which must correctly validate its own signature scheme (often ERC-1271 for contract-based signatures) before approving any action.
  • Paymaster - an optional contract that sponsors gas on the sender's behalf, and which the EntryPoint debits directly from a deposit it holds.
  • Bundler - the off-chain actor that simulates, orders, and submits UserOperations, and that gets paid out of the sender's or paymaster's funds regardless of how the sponsored call turns out.
  • EntryPoint - the on-chain singleton that enforces the validation-then-execution lifecycle every other party relies on.

Most of the generic "what is account abstraction" explainers stop at describing these four roles. The incidents happen at the seams between them, which is where the rest of this post stays.

Paymaster Drain Attacks and Pre- vs Post-Execution Charging

A paymaster drain attack doesn't need to break cryptography. It only needs to find a cheaper way to spend the paymaster's deposit than the paymaster expected, whether by spamming invalid operations, tricking it into sponsoring calls that revert, or exploiting a timing gap in how it charges the user back.

Open and Misconfigured Paymasters: How Deposits Get Drained

ERC-4337's own documentation names griefing against paymasters as a distinct risk category, separate from bugs in the smart account itself. It lists three core vectors: draining a paymaster's deposit by spamming invalid operations, tricking a paymaster into sponsoring high-cost or reverted calls, and exploiting timeouts or race conditions in its verification logic.

An open paymaster, one that will sponsor gas for any sender without an allowlist, rate limit, or stake check, is the easiest version of this to exploit. An attacker submits a flood of UserOperations that pass the paymaster's validation but are designed to be expensive or to revert during execution, and the paymaster's on-chain deposit pays for every one of them. The original ERC-4337 specification flagged this exact scenario years before any production paymaster shipped at scale, warning that maliciously crafted paymasters could pose a risk of a denial-of-service attack: "bundlers should use a reputation system for contracts they serve, and the paymaster must either limit its storage usage, or deposit a stake in a reputation system."

Why postOp() Failures Still Cost the Paymaster

A paymaster that approves a UserOperation during validation can still run a postOp() callback after execution, typically to pull its fee from the user in a token other than ETH. The catch: if that postOp() call fails, for example because the user revoked their token allowance between validation and execution, the EntryPoint still completes execution and pays the bundler from the paymaster's deposit rather than rolling back the user's action.

That creates a griefing path where a bundler, or anyone colluding with one, can profit by deliberately forcing postOp() failures.

Real Incident: The Lumi Finance Sodium Smart Account Exploit ($270K)

On July 13, 2026, an exploit against Sodium smart accounts on Arbitrum, used by Lumi Finance, drained approximately $270,000 across multiple accounts in a single attack. This is a useful case study precisely because it is not a simulation-vs-execution edge case or a griefing-for-pennies scheme. It shows what happens when the trust boundaries described above collapse into one actor.

The attacker combined an ERC-1271 signature-validation bypass with a flaw letting a malicious paymaster grant itself unlimited ERC-20 token allowances during the validateUserOp phase. In the ERC-4337 model, the sender, the paymaster, and the bundler are supposed to be separate parties with separate incentives, which is the whole premise behind reputation systems and staking requirements. Here, the same malicious contract acted as the ERC-1271 signer, the proposed session key, the paymaster, the approved ERC-20 spender, and later the token sweeper, occupying every role the protocol assumes would check the others.

That is the real lesson for account abstraction security: validating a signature correctly and validating who is allowed to be the paymaster, the signer, and the spender in the same flow are not the same check, and a smart account that only does the first one is still exposed. QuillAudits' research hub tracks forensic breakdowns of live exploits like this one as they happen, which is worth watching if a team is shipping its own ERC-4337 infrastructure.

Bundler Trust and Simulation-vs-Execution Mismatches

A bundler decides what gets included in a block before the EntryPoint ever sees it, and it makes that decision based on an off-chain simulation of a UserOperation, not its actual on-chain execution. The gap between those two things is a second attack surface entirely separate from anything a paymaster does.

Why a UserOperation Can Pass Simulation and Still Fail (or Get Exploited) On-Chain

A bundler simulates a UserOperation locally to decide whether it will pay out and whether it's safe to include. The problem is that some values a contract can read, like the current block's timestamp, block number, or gas price, can differ between the moment of simulation and the moment of on-chain inclusion. A UserOperation can be crafted to look valid and profitable during simulation, then behave entirely differently once it actually lands on-chain, either reverting and wasting bundler gas or executing a path the bundler never checked.

ERC-7562's Banned Opcodes and Storage Rules, Explained

ERC-7562 is the specification that defines exactly which opcodes and storage access patterns a UserOperation's validation phase is allowed to use, precisely to close the simulation-vs-execution gap. It bans opcodes including ORIGIN, GASPRICE, BLOCKHASH, COINBASE, TIMESTAMP, and NUMBER during validation because their return values can change between off-chain simulation and on-chain inclusion, letting a crafted UserOperation pass simulation but revert or behave differently on-chain. It also restricts which storage slots a sender or paymaster can touch during validation, so a contract can't pass simulation by reading state that a different, unrelated transaction could change out from under it before inclusion.

The practical effect for anyone building a custom paymaster or smart account: if your validation logic reads any of those banned opcodes, or touches storage outside the allowed scope, a compliant bundler will reject the UserOperation outright, or worse, an incompliant one will accept it and you'll be exposed to exactly the mismatch ERC-7562 exists to prevent.

Bundler Censorship and Centralization Risk

Because a bundler chooses which UserOperations to include and in what order, it holds the same kind of power over ERC-4337 traffic that a block builder holds over the base mempool, with far less tooling built up around it so far. A bundler can selectively delay or drop operations from specific senders, extract value by reordering competing operations, or simply go offline and take an entire application's sponsored-gas flow down with it if there's no fallback bundler configured. None of that requires a bug. It's a direct consequence of relying on a small number of bundler operators to relay a growing share of on-chain activity, which is also why EIP-7702 (covered in QuillAudits' piece on account abstraction's new era) takes a different approach entirely, letting an Externally Owned Account, or EOA, delegate to contract logic directly rather than routing everything through a separate mempool and bundler layer.

Prevention Measures for Smart Account Teams

Most of the fixes here don't require inventing new cryptography. They require treating the paymaster and bundler as part of the attack surface during a security review, not as infrastructure someone else is responsible for.

A Paymaster and Bundler Security Checklist

If you're also running a Safe or another modular smart account alongside an ERC-4337 setup, the module and guard configuration carries its own separate risk; see QuillAudits' breakdown of Safe module and guard misconfiguration risks and the operational habits in multisig security habits that actually matter for the parts of the stack this checklist doesn't cover. Teams scoping a broader pre-launch review can start from QuillAudits' general Web3 security checklist and narrow in from there.

Monitoring and Auditing Paymaster/Account Contracts After Launch

A code review before launch doesn't catch a paymaster deposit getting drained by traffic patterns that only show up in production. QuillAudits' Smart Contract Monitoring service and its companion post on on-chain security monitoring cover the general version of this: tracking transaction volume, gas usage, and unusual function calls against a deployed contract after it goes live. For a paymaster specifically, that means watching deposit balance trends, allowance grants made during validateUserOp, and any spike in reverted or high-gas sponsored operations, the kind of pattern a one-time audit can't see because it hasn't happened yet.

Account abstraction security is also a newer risk category than the wallet-compromise losses most teams already plan around; QuillAudits has tracked wallet and private key compromise as crypto's costliest attack vector, and a paymaster or bundler-level exploit is a distinct failure mode sitting on top of that, not a replacement for it. None of the paymaster-specific fixes above extend to bundler-level infrastructure choices, though: simulation-vs-execution mismatches and censorship risk live in mempool and relay operations outside any single contract's code, so a team worried specifically about bundler behavior needs due diligence on its bundler provider, not just a contract audit.

Final Thoughts

A paymaster or bundler misconfiguration doesn't show up in a wallet-only review, and the Lumi Finance exploit shows what happens when a single contract is allowed to occupy every trust role ERC-4337 assumes would stay separate. Teams shipping custom ERC-4337 infrastructure should treat the validation phase, the paymaster's deposit logic, and the bundler relationship as part of the audit scope, not an assumption borrowed from someone else's deployment. A Smart Contract Audit can review that custom paymaster and validateUserOp logic before it ever reaches production.

Explore more Security Decisions

Contents

Tell Us About Your Project
Subscribe to Newsletter
hashing bits image
Loading...
Loading...

WE SECURE EVERYTHING YOU BUILD.

From day-zero risk mapping to exchange-ready audits, QuillAudits helps projects grow with confidence. Smart contracts, dApps, infrastructure, compliance: secured end to end.

QuillAudits Logo


ISO 27001Circle Alliance Program
Uniswap FoundationAethiropt-collectivePolygon SPNBNB Chain Kickstart

All Rights Reserved. © 2026. QuillAudits - LLC