Griefing attacks on handleOps and multiSend logic
The handleOps function reverts the entire batch if any single user operation fails, and multiSend similarly reverts if any inner transaction fails. An attacker could front-run a relayer's batch with a transaction that executes only the last user operation, causing the relayer's transaction to revert after consuming gas for all other operations.
Submitted by V_B, also found by peanuts, HE1M, and debo
contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L68 contracts/smart-contract-wallet/libs/MultiSend.sol#L26
The handleOps function executes an array of UserOperation. If at least one user operation fails the whole transaction will revert. That means the error on one user ops will fully reverts the other executed ops.
The multiSend function reverts if at least one of the transactions fails, so it is also vulnerable to such type of attacks.
Attack scenario
Relayer offchain verify the batch of UserOperations, convinced that they will receive fees, then send the handleOps transaction to the mempool. An attacker front-run the relayers transaction with another handleOps transaction that executes only one UserOperation, the last user operation from the relayers handleOps operations. An attacker will receive the funds for one UserOperation. Original relayers transaction will consume gas for the execution of all except one, user ops, but reverts at the end.
Impact
Griefing attacks on the gas used for handleOps and multiSend function calls.
Please note, that while an attacker have no direct incentive to make such an attacks, they could short the token before the attack.
Recommended Mitigation Steps
Remove redundant require-like checks from internal functions called from the handleOps function and add the non-atomic execution logic to the multiSend function.
livingrockrises (Biconomy) acknowledged and commented:
Once public, will double check with infinitism community. Marked acknowledged for now. And for multisend non-atomic does not make sense!
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 batch execution functions use all-or-nothing semantics, reverting the whole batch when any single operation fails, instead of allowing partial success.
Impact
A relayer could lose the gas spent on a batch because the transaction reverts, and the attacker may profit by shorting the token before the attack.
What the attacker needed
Attacker can front-run transactions; relayer submits a batch of user operations; attacker may short the token beforehand
The fix
The report recommends removing redundant require-like checks from internal functions called by handleOps and adding non-atomic execution logic to multiSend, though the project acknowledged the issue and disputed the multiSend change.
How it was found
- Relayer verifies a batch of user operations off-chain and submits handleOps to the mempool.
- Attacker front-runs the relayer's transaction with another handleOps that executes only the last user operation from the relayer's batch.
- The attacker receives the fee for that one user operation.
- The relayer's transaction executes all other user operations but reverts at the end, wasting gas.
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.
A relayer is a service that submits a batch of actions on behalf of users and expects to be paid for the gas it spends. Here, if any one action in the batch fails, the whole batch is cancelled and all the gas spent on the other actions is wasted. An attacker can deliberately cause one action to fail, so the relayer loses money.
What is Smart contracts?
Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.