Skip to content
NFTVenue Ledger
Directory

Erc721 Erc1155 Eip712 Permit Security

ERC-4337 Account Abstraction Security: EntryPoint Storage Rules & Paymaster Griefing

Because ERC-4337 bundlers pay L1/L2 gas upfront for untrusted UserOperations, strict ERC-7562 opcode and storage-access sandboxing prevents mass mempool invalidation DoS.

By Dr. Devon Kurosawa, PhDReview not recorded · Updated
ERC-4337 Account Abstraction Security: EntryPoint Storage Rules & Paymaster Griefing — NFTVenue Ledger 2026 quantitative & supervisory data card
NFTVenue Ledger (EIP-712 Signatures, Permit2 Allowance Security, Royalties & Proxy Timelocks): ERC-7562 opcode sandboxing, upfront ERC20Paymaster escrows, and 10% unused-gas guards.Source: NFTVenue Ledger Institutional Research DeskLicense: CC-BY-4.0

In classic Ethereum, validating an EOA transaction requires checking one fixed ecrecover signature and one account balance/nonce—taking microseconds and zero arbitrary EVM execution. ERC-4337 Account Abstraction (EntryPoint v0.7 at 0x0000000071727De22E5E9d8BAf0edAc6f37da032) turns signature and gas-payment validation into arbitrary Turing-complete smart-contract execution inside validateUserOp and validatePaymasterUserOp!

Anchored in our EIP-712, Permit2 & proxy security master guide, an immediate Asymmetric DoS Trap arises: what stops an attacker from submitting 1,000 PackedUserOperations that pass off-chain bundler eth_estimateUserOperationGas simulation, then flip one shared storage variable on-chain so all 1,000 UserOps revert inside handleOps—sticking the Bundler with zero reimbursement?

ERC-7562 Validation Sandboxing: Banned Opcodes & Associated Storage#

ERC-4337 and ERC-7562 eliminate simulation-to-execution invalidation vectors by strictly partitioning every handleOps call into an isolated Validation Phase followed by an Execution Phase:

  1. Banned Environment Opcodes During Validation: Unless an entity (Factory, Account, Paymaster) stakes native ETH inside EntryPoint, calling volatile environment opcodes—TIMESTAMP, NUMBER, COINBASE, PREVRANDAO, BASEFEE, GASPRICE, BLOBBASEFEE—during validateUserOp is strictly forbidden by bundler tracers! (Time-bounded signatures must return validAfter and validUntil inside packed validationData so EntryPoint checks block.timestamp deterministically!)
  2. Associated Storage Isolation: Unstaked smart accounts may touch only storage slots belonging to address(account) itself (or keccak256(abi.encode(account, slot)) associated mapping slots in external ERC-20 contracts), preventing 1,000 attacker accounts from reading one shared "kill-switch" contract slot!
ERC-4337 EntryPoint v0.7 two-phase validation and execution loop with Paymaster gas sponsorship
ERC-4337 EntryPoint v0.7 two-phase validation and execution loop with Paymaster gas sponsorshipVerified Exhibit

Three Critical Paymaster & Smart-Account Bugs in DeFi / NFT Venues#

Integrating sponsored gasless onboarding across consumer NFT drops and DEXs in our marketplaces directory (such as Basepaint, Alts By Adidas, and Art Blocks X Bright Moments) exposes custom ERC20Paymaster and VerifyingPaymaster contracts to three classic exploits:

  • Exploit 1 — userOpHash Omission of chainId or entryPoint in Custom Signers: Always verify signatures over entryPoint.getUserOpHash(userOp), which commits to (packedUserOp, address(entryPoint), block.chainid)—never hash raw userOp.callData alone!
  • Exploit 2 — ERC-20 Paymaster Approval Revocation inside execute (postOp Griefing): Suppose an ERC20Paymaster checks USDC.allowance(user, paymaster) >= maxCost during validatePaymasterUserOp, intending to pull USDC inside postOp. During Step 3 (execute), the malicious user's callData calls USDC.approve(paymaster, 0)! In EntryPoint v0.6, a reverting postOp caused a dual-pass retry trap; in v0.7, ERC20Paymasters must either escrow maxCost upfront inside validatePaymasterUserOp and refund the delta in postOp, or account for reverted execution cleanly!
  • Exploit 3 — Inflated callGasLimit Bundler Starvation: Prior to v0.7, attackers set callGasLimit = 5,000,000 while consuming only 30,000 gas, packing a block with empty gas reservations so bundlers earned near-zero fees. EntryPoint v0.7 charges a 10% penalty on unused execution/postOp gas exceeding 40,000 gas!

ERC-4337 v0.6 vs EntryPoint v0.7 Security Upgrades#

Security / Gas DimensionLegacy EntryPoint v0.6Audited EntryPoint v0.7Security & Cost Impact
UserOperation Struct Layout11 separate 32-byte fieldsPackedUserOperation (bytes32 accountGasLimits)-18% to -28% L2 calldata gas
Unused callGasLimit GriefingUnpenalized reservation bloat10% charge on unused gas > 40kStops bundler block-space starvation
postOp Second-Pass AttackComplex postOpReverted double-runSingle clean execution + postOpGasLimitEliminates Paymaster drainage edge cases
ERC-4337 Module IsolationAd-hoc plugin hooksERC-7579 Modular Smart AccountsStandardized Validator/Executor boundaries
L2 transaction cost and bundler DoS surface reduction from ERC-4337 EntryPoint v0.6 to v0.7
L2 transaction cost and bundler DoS surface reduction from ERC-4337 EntryPoint v0.6 to v0.7Verified Exhibit

EntryPoint v0.7 Prefund & 10% Unused-Gas Penalty Formula#

Auditors verify that both SmartAccount and Paymaster calculate requiredPreFund accurately, accounting for v0.7's packed accountGasLimits and 10% unused gas surcharge:

Formula or model from the articleNot independently verified
EntryPoint v0.7 Packed Gas Accounting & Unused-Gas Anti-Griefing Surcharge:
  • 1) Unpacking PackedUserOperation Gas Fields:
  • verificationGasLimit = uint128(bytes16(accountGasLimits))
  • callGasLimit = uint128(uint256(accountGasLimits))
  • maxPriorityFeePerGas = uint128(bytes16(gasFees))
  • maxFeePerGas = uint128(uint256(gasFees))
  • 2) Maximum Upfront EntryPoint Deposit Lock (requiredPreFund):
  • maxGas = preVerificationGas + verificationGasLimit + callGasLimit + paymasterVerificationGasLimit + paymasterPostOpGasLimit
  • maxPreFund = maxGas * maxFeePerGas
  • 3) v0.7 Unused Execution Gas Penalty (Blocks Block-Stuffing DoS):
  • unusedGas = callGasLimit - actualExecutionGasUsed
  • surcharge = (unusedGas > 40,000) ? (0.10 * unusedGas) : 0
  • finalBill = (actualTotalGas + surcharge) * min(maxFeePerGas, block.basefee + maxPriorityFeePerGas)
  • Worked ERC20Paymaster Escrow Check ($3,000 ETH, 0.05 gwei L2 gas, maxGas = 400,000):
  • Paymaster locks 0.06 USDC upfront during validatePaymasterUserOp; actual swap uses 180,000 gas (unused = 70k -> +7k penalty)
  • => postOp refunds 0.031 USDC cleanly; even if user revokes USDC allowance inside execute, Paymaster loses $0.00!

Convergence With Pectra EIP-7702 Native EOA Delegation#

With Ethereum's Pectra upgrade introducing EIP-7702, existing EOAs can temporarily or persistently point their codehash to an ERC-4337 smart-account implementation without migrating assets—creating a fierce new phishing battleground analyzed next in EIP-7702 EOA code delegation security and ERC-1271 signature replay inside our EIP-712, Permit2 & Proxy Security hub.

Frequently asked questions

Why does ERC-4337 ban block.timestamp inside validateUserOp?

If validateUserOp checked require(block.timestamp < X) directly, an attacker could craft thousands of UserOps that pass off-chain simulation at t = X - 1 and all revert at t = X, exhausting bundler resources without paying gas; instead, accounts return validUntil for EntryPoint to check.

How can a malicious user drain a poorly written ERC-20 Paymaster?

If the Paymaster only checks USDC.allowance in validation and waits until postOp to call transferFrom, the user execution step can call USDC.approve(paymaster, 0) or transfer away their USDC so postOp fails to collect payment.

Why did EntryPoint v0.7 add a 10% penalty on unused callGasLimit?

Bundlers reserve block gas capacity based on declared callGasLimit; without a penalty, attackers reserved millions of unused gas units per UserOp to starve bundlers of priority-fee revenue.

How do parallel nonces work in ERC-4337 EntryPoint?

EntryPoint getNonce(sender, uint192 key) maintains an independent 64-bit sequence counter for every 192-bit key, allowing a DeFi session key on lane #1 to execute without colliding with user swaps on lane #0.

Publication record

Published
November 13, 2026
Updated
November 14, 2026
Author
Dr. Devon Kurosawa, PhD
Review
Review not recorded
Automated fact check
Passed in the stored pipeline record
Source URLs
3 recorded

AI assistance recorded: anthropic/claude-opus-4.6. This field does not establish human review or source verification.

Academic & Institutional Attribution

Cite This Research & Embed Live Data Card

Open Attribution License (CC BY 4.0)

Standard academic & institutional research paper citation format.

Dr. Devon Kurosawa, PhD. (2026, November 14). ERC-4337 Account Abstraction Security: EntryPoint Storage Rules & Paymaster Griefing. NFTVenue Ledger. https://nftvenueledger.com/protocols/erc-4337-entrypoint-paymaster-userop-validation-griefing
Explore Erc721 Erc1155 Eip712 Permit Security Hub (20) →

NFTVenue Ledger Data, Benchmarks & Contributor Records

ERC-4337 Security: EntryPoint Rules & Paymaster Griefing | NFTVenue Ledger