ERC-4337 Smart Account Risks

ERC-4337 smart accounts expand the attack surface beyond a single private key: replay attacks, gas manipulation

SECURITY5 min readBy AlgoSys Editorial TeamPublished Apr 24, 2026Updated Nov 28, 2026
Contents

ERC-4337 brings smart accounts to Ethereum and noticeably improves the user experience. Social account recovery and gas abstraction (the ability to pay the fee not necessarily with the same asset or by the user themselves) both become available. The price of this convenience is a set of new attack vectors that did not exist with traditional EOA wallets (externally owned accounts, wallets controlled by a single private key).

The root of the problem is that all the additional logic now lives in code. An attacker can target either the smart account logic itself or the bundler infrastructure (nodes that package operations into batches). A successful exploit leads to unauthorized asset transfers, denial of service, or substitution of an account's recovery mechanism. High-profile incidents involving smart contract vulnerabilities, even those not directly tied to ERC-4337, clearly show how sophisticated attacks in account abstraction environments can be.

Two groups are in the line of fire. The first is users interacting with vulnerable smart accounts. The second is protocols that have carelessly integrated ERC-4337 features. The attacker's goal in both cases is the same: drain funds, disrupt service, or strip users of control over their accounts.

MECHANICS

One notable risk is replay attacks. An attacker intercepts a valid User Operation (UserOp, a description of the user's intent in ERC-4337 format) and resubmits it to the network. This becomes possible when a UserOp is signed incorrectly or when the target network and block context are not validated inside the UserOp's execution. That allows the same operation to be replayed.

A second threat involves gas manipulation. The attacker exploits the bundler mechanism by submitting a UserOp with an abnormally low gas price, causing legitimate operations to either fail entirely or get stuck in the queue with a long delay. Another variant of the same idea is manipulating gas refunds or bundler incentives, which directly leads to economic losses.

A separate category is compromised entry points. A vulnerable AccountFactory contract or a defective EntryPoint implementation allows attackers to deploy malicious smart accounts or hijack existing ones. This typically stems from a logic error in the validateOp or executeBatch functions of the EntryPoint contract, that is, in the very code that is supposed to validate and execute operations.

RISK INDICATORS

The warning signs fall into several groups. First look at the contracts themselves and how well they are protected, then at operation traffic, and separately at bundler infrastructure.

  • Weak access control: critical functions (changing the owner or initiating recovery) are not protected by solid permission checks. This is the first thing an attacker tests.
  • Abnormal gas: UserOps are submitted with an unusually low gas price or gas limit. This is often a direct trace of a gas manipulation attempt.
  • Custom logic in EntryPoint: the contract code deviates from the standard ERC-4337 specification. Any such deviation is a potential unforeseen vulnerability.
  • No replay protection: UserOps lack chain ID (network identifier) and nonce (sequence number) checks. Without them an operation can be replayed on another network or on the same one.
  • Dubious bundler: a compromised bundler selectively includes or excludes UserOps, which is already censorship and denial of service.
  • Leaky AccountFactory: the factory allows the creation of unauthorized or malicious smart accounts.

PROTECTION

The foundation of protection is strict validation inside your EntryPoint contract. Correct nonce management and signature verification for all UserOps close both replay attacks and part of the takeover attempts at once.

Do not write critical contracts from scratch without a compelling reason. Take audited implementations of EntryPoint and AccountFactory from reputable sources, and run any custom logic you add on top of them through a thorough security audit, because that logic is most often where the weak point ends up.

For sensitive operations such as account recovery or ownership changes, design the smart account with multi-factor authentication: require multiple signatures or multiple conditions to be met, so that a single compromised signature is not enough.

Do not forget the person on the other side of the wallet. Educate users that before approving a UserOp through the wallet interface they need to verify the transaction details, gas parameters, and recipient address.

Finally, gas price oracles and dynamic gas estimation work against gas manipulation: they ensure that a UserOp is submitted with enough headroom and does not fail due to an artificially created shortage.

To make it clear where the boundary between the two types of wallets lies, here are the key differences in a table.

Parameter EOA wallet ERC-4337 smart account
Access control Single private key Programmable logic in code
Attack surface Key security EntryPoint, AccountFactory, validation contracts
Recovery Seed phrase only Social recovery, multisig
Gas payment By the user only Gas abstraction (sponsor, different asset)
New vectors Key theft Replay, gas manipulation, bundler censorship

How to tell a real threat from a false alarm: a low gas price on a single operation may simply be a user saving money, but a series of UserOps with underpriced gas that systematically crowd out other legitimate operations is the signature of manipulation. Likewise, custom logic in EntryPoint is not dangerous by itself, only when it changes nonce validation, signature checking, or access rights. A deviation in those places is a red flag; a deviation in logging or event emission is most likely harmless.

AFTERMATH

If an exploit is already suspected, follow the steps in order. First, immediately revoke all compromised administrative privileges and owner roles associated with the affected smart account to cut off the outflow of funds.

Next comes communication. Alert your user base and the security community through established channels such as Discord or Twitter, or through dedicated incident reporting platforms. Reaching out to specialized teams such as SEAL 911 brings expert help exactly when every minute counts.

At the same time, begin recovery efforts. Bring in blockchain analytics firms and law enforcement to trace illicit fund flows. Reporting to the relevant authorities promptly is critical for any potential legal recourse.

FAQ

Why is an ERC-4337 smart account riskier than a regular EOA wallet?

A regular wallet (EOA, externally owned account) is protected by a single private key, and all its risk comes down to keeping that key safe. A smart account adds programmable logic: social recovery, gas payment on behalf of the user, batch operations. Each such feature lives in contract code, which means it can contain a bug. You gain convenience but in exchange you expand the attack surface to the EntryPoint, AccountFactory, and validation logic contracts themselves.

What is a replay attack on a UserOperation and how do you defend against it?

A replay attack occurs when an attacker intercepts an already-signed UserOperation and submits it to the network a second time. If the operation is not tied to a specific network and sequence number, the replay will pass validation and execute again. The defense is straightforward in principle: every UserOp must check the chain ID (network identifier) and the nonce (sequence number that prevents replays). That way an already-used operation cannot be replayed on the same network or on a different one.

Can a bundler harm the user?

Yes. A bundler (a node that bundles UserOperations together and submits them to the network) occupies a middleman position. A compromised or dishonest bundler can selectively include some operations and ignore others, which amounts to censorship or denial of service. It can also play the gas refunds and bundler incentives to its own advantage. Bundler security therefore deserves separate evaluation rather than being treated as a neutral pipe.

Why is it important to use audited EntryPoint and AccountFactory implementations?

EntryPoint and AccountFactory are the central contracts of the entire scheme: the first validates and executes operations, the second creates new smart accounts. A logic error in functions such as validateOp, executeBatch, or in the factory opens the door to taking over existing accounts or deploying malicious ones. Ready-made, verified implementations from reputable sources have already been audited and battle-tested. Any custom logic you add on top of them must go through a separate audit, because it is precisely those deviations from the standard that most often turn out to be the hole.

What should you do first if you suspect a smart account exploit?

First, revoke all compromised administrative privileges and owner roles associated with the affected account to stop the outflow of funds. Then alert users and the security community through familiar channels (Discord, Twitter) and, if needed, reach out to dedicated teams such as SEAL 911. At the same time, bring in blockchain analytics firms and law enforcement to trace fund movements and pursue recovery.

Put this to work in the terminal

Live charts, derivatives, on-chain and macro data, free.

Open terminal →