ERC4337 is the account abstraction standard for Ethereum — it enables "smart accounts" where users interact with DeFi without needing native ETH for gas, using flexible signature schemes, and with programmable recovery mechanisms. As adoption grows across Base, Polygon, and Arbitrum, the unique security model of account abstraction requires careful attention.
ERC4337 introduces several new actors with distinct trust assumptions:
validateUserOp.Paymasters hold ETH deposits in the EntryPoint to sponsor transactions. A malicious or misconfigured paymaster can be drained by:
verificationGasLimit or callGasLimit in a UserOperation wastes more of the paymaster's deposit per transactionAlways implement strict allowlist-based or signature-based paymaster validation:
function _validatePaymasterUserOp(UserOperation calldata op, bytes32, uint256)
internal override returns (bytes memory, uint256) {
address sender = op.sender;
require(allowedSenders[sender], "Paymaster: sender not allowed");
return ("", 0);
}
The account contract's validateUserOp function must correctly verify the UserOperation signature. Common bugs:
chainId in the signed hash — enables cross-chain replay of UserOperationsEntryPoint address — a UserOperation signed for one EntryPoint version can be replayed on anotherECDSA.recover from OpenZeppelin, which rejects malleable signaturesSee signature replay for the underlying vulnerability.
The execute function in a smart account runs arbitrary calldata — which means it can call back into the account contract or EntryPoint during execution. The ERC4337 spec includes reentrancy protection in the EntryPoint, but custom account implementations may bypass this. Apply ReentrancyGuard to account-level execution functions. See reentrancy.
Social recovery and guardian schemes in smart accounts often allow guardian addresses to change the signing key after a delay. If the guardian list is misconfigured (wrong addresses, no delay, no threshold), an attacker who compromises a guardian key gains full account control. Always use a multisig threshold for guardian operations and implement a timelock delay.
Bundlers can theoretically censor specific accounts' UserOperations by refusing to include them. For high-value or time-sensitive operations, plan for bundler censorship by using multiple bundler providers or fallback to direct L1 submission where possible.
SmartContract.us analyzes account contracts, paymaster implementations, and factory contracts for the ERC4337 ecosystem. Analyze an account contract →