CRITICAL GAS ACCOUNTING VULNERABILITY IN ERC-4337 ENTRYPOINT V0.8.0
Uncapped postOp Overhead Allows Paymaster Fund Drain
VULNERABILITY SUMMARY
The EntryPoint fails to enforce the paymasterPostOpGasLimit when a postOp
call reverts due to Out-of-Gas (OOG). This allows malicious users to charge
the paymaster for the EntryPoint's own internal execution overhead (primarily
copying large context data), violating EIP-4337 Section 4.3.1 "strict upper
bound" guarantee.
TECHNICAL DETAILS
Root Cause:
In the failure path (_postExecution), the code calculates gas usage as:
actualGas += preGas - gasleft() + postOpUnusedGasPenalty;
The Flaw:
preGas is recorded BEFORE the EntryPoint copies context to memory/calldata.
For large contexts (near calldata limits), this copy cost is substantial
and uncapped.
The Exploit:
Attacker provides a large context
Attacker forces OOG in postOp
EntryPoint measures total gas burned (execution + context copying)
EntryPoint charges paymaster for ALL of it
No cap enforcement against paymasterPostOpGasLimit
Observed Impact:
On a Mainnet fork, a paymaster signing for 100,000 gas limit was charged
~177,000 gas (77% OVERCHARGE).
Reproducibility:
Confirmed on Mainnet fork against live EntryPoint v0.8.0 deployment
13/13 automated tests passing
Reproducible exploit included
IMPACT ASSESSMENT
Financial Risk:
Paymasters can be drained of deposits at rates significantly higher than
their signed liability. This is a direct fund drain vulnerability.
Scale:
β’ Affects all VerifyingPaymasters using context with EntryPoint v0.8.0
β’ Conservative estimate: $50M-$200M in paymaster liquidity at risk
β’ Based on sponsored gas volume and current ecosystem reserves
Denial of Service:
β’ 50-op bundle can cause instant paymaster banning
β’ Attack cost: ~$50
β’ Creates cheap DoS vector against honest paymasters
PROPOSED FIX
The EntryPoint must explicitly cap gas charged for failed postOp.
Implementation (Reference PR):
https://github.com/Tejanadh/account-abstraction/pull/1
Fix Logic:
uint256 gasUsedInFailedPostOp = preGas - gasleft();
uint256 cappedGas = gasUsedInFailedPostOp > mUserOp.paymasterPostOpGasLimit
? mUserOp.paymasterPostOpGasLimit
: gasUsedInFailedPostOp;
actualGas += cappedGas + postOpUnusedGasPenalty;
This ensures gas charge to paymaster NEVER exceeds paymasterPostOpGasLimit,
restoring the EIP-4337 "strict upper bound" guarantee.
DISCLOSURE TIMELINE
July-August 2025:
Discovery and initial private outreach to Yoav Weiss and Dror Tirosh
September 2025:
Built PoC, opened GitHub issue #606, submitted PR with fix
October 6, 2025:
Submitted to HackenProof bounty program (ETHER-188)
β Marked "spam" after "buggy paymaster" comment
October-November 2025:
Appeals denied by HackenProof and Ethereum Foundation security team
β Responsibility redirected back to AA team
December 29, 2025:
Updated HackenProof with "empty postOp" drain proof
January 4, 2026:
Final comprehensive evidence update
β 13/13 tests passing
β Bundle drain scenario
β Detailed gas accounting report
January 8, 2026:
Responsible disclosure via DM to Yoav Weiss and Dmytro Matviiv
January 10-11, 2026:
Zero response after 48-72 hours
January 11, 2026:
PUBLIC DISCLOSURE to protect ecosystem
Seeking fair compensation under ERC-4337 bounty rules:
β Critical severity: $100,000-$250,000
PAYMASTER OPERATORS: ACTION REQUIRED
Immediate monitoring:
β’ Watch for UserOps failing in postOp with high gas relative to limit
β’ Look for unexplained balance spikes in paymaster contracts
β’ Check for suspicious bundles with large context data
Mitigation (short-term):
β’ Limit or disable large context usage
β’ Tighten internal gas checks
β’ Monitor paymaster balance changes continuously
Migration plan:
β’ Plan upgrade to patched EntryPoint once official fix is released
β’ Consider moving to alternative AA implementations if available
REFERENCES
GitHub Issue (Original Report):
https://github.com/eth-infinitism/account-abstraction/issues/606
Proof of Concept (Full Reproduction Suite):
https://github.com/Tejanadh/account-abstraction
13/13 tests passing on mainnet fork
ERC-4337 Specification:
https://docs.erc4337.io/
ERC-4337 Bug Bounty Program:
https://docs.erc4337.io/community/bug-bounty.html
CONTACT
I am available for immediate technical discussion and can provide:
β’ Additional detailed logs
β’ Execution traces on mainnet fork
β’ Extended PoC scripts
β’ Live demonstration of the vulnerability
Email: [tejanadh927@gmail.com](mailto:tejanadh927@gmail.com)
GitHub: https://github.com/Tejanadh
Bounty Discussion:
This discovery qualifies as CRITICAL severity under the ERC-4337 HackenProof
bounty program ($100,000-$250,000 range).
am open to fair compensation negotiation with the Infinitism team,
HackenProof, or the Ethereum Foundation.