Skip to content
DoS Audit finding Advanced

DoS of user operations and loss of user transaction fee due to insufficient gas value submission by malicious bundler

A malicious bundler could submit a bundle of user operations with insufficient gas, causing the inner call to fail even when users set correct gas limits. This results in a denial of service for the user, and the user or paymaster still pays for the failed execution, potentially draining funds.

peakbolt Follow with V_B, zaskoh and 1 other

Originally disclosed on Code4rena

Submitted by peakbolt, also found by V_B, zaskoh, and csanuragjain

contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L68-L86 contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L168-L190

An attacker (e.g. a malicious bundler) could submit a bundle of high gas usage user operations with insufficient gas value, causing the bundle to fail even when the users calculated the gas limits correctly. This will result in a DoS for the user and the user/paymaster still have to pay for the execution, potentially draining their funds. This attack is possible as user operations are included by bundlers from the UserOperation mempool into the Ethereum block (see post on ERC-4337 https://medium.com/infinitism/erc-4337-account-abstraction-without-ethereum-protocol-changes-d75c9d94dc4a).

Reference for this issue: https://github.com/eth-infinitism/account-abstraction/commit/4fef857019dc2efbc415ac9fc549b222b07131ef

Proof of Concept

In innerHandleOp(), a call was made to handle the operation with the specified mUserOp.callGasLimit. However, a malicious bundler could call the innerHandleOp() via handleOps() with a gas value that is insufficient for the transactions, resulting in the call to fail.

The remaining gas amount (e.g. gasLeft()) at this point was not verified to ensure that it is more than enough to fulfill the specified mUserOp.callGasLimit for the user operation. Even though the operation failed, the user/payment will still pay for the transactions due to the post operation logic.

contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L176

(bool success,bytes memory result) = address(mUserOp.sender).call{gas : mUserOp.callGasLimit}(callData);

Recommended Mitigation Steps

Update the Account Abstraction implementation to the latest version. This will update the innerHandleOp() to verify that remaining gas is more than sufficient to cover the specified mUserOp.callGasLimit and mUserOp.verificationGasLimit.

Reference: https://github.com/eth-infinitism/account-abstraction/commit/4fef857019dc2efbc415ac9fc549b222b07131ef

livingrockrises (Biconomy) disagreed with severity and commented:

If bundle fails, bundler has no incentive. Lacks proof for draining funds.

livingrockrises (Biconomy) confirmed and commented:

Lack of proof.

“Update the Account Abstraction implementation to the latest version. This will update the innerHandleOp() to verify that remaining gas is more than sufficient to cover the specified mUserOp.callGasLimit and mUserOp.verificationGasLimit.” Will be doing this.

gzeon (judge) decreased severity to Medium


The original report as published on Code4rena, by peakbolt. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the innerHandleOp function does not check that the remaining gas is sufficient to cover the specified callGasLimit and verificationGasLimit before making the call.

Impact

This could cause a denial of service for the user and potentially drain the user's or paymaster's funds, though the report lacks proof of draining funds and the judge decreased severity to Medium.

What the attacker needed

Attacker acts as a bundler; user operations in mempool

The fix

The Account Abstraction implementation should be updated to the latest version, which verifies that remaining gas is sufficient to cover the specified callGasLimit and verificationGasLimit.

How it was found

  1. A malicious bundler submits a bundle of high gas usage user operations with insufficient gas value.
  2. The bundle fails because the inner call does not have enough gas.
  3. The user or paymaster still pays for the failed execution.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

In account abstraction, a bundler packages user operations into a transaction. If the bundler provides too little gas, the operation fails, but the user still pays. This lets a malicious bundler block users and waste their money.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by peakbolt

View all

16 more disclosed reports, best first.

More from Biconomy - Smart Contract Wallet contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.