Calls inside loops that may address DoS
The contract makes external calls inside loops, which could cause a denial of service if one call reverts or runs out of gas. An attacker could exploit this with a malicious token to block batch operations.
Originally disclosed on Code4rena
Submitted by sorrynotsorry
Calls to external contracts inside a loop are dangerous (especially if the loop index can be user-controlled) because it could lead to DoS if one of the calls reverts or execution runs out of gas. Reference
Recommended Mitigation Steps
Avoid combining multiple calls in a single transaction, especially when calls are executed as part of a loop. Always assume that external calls can fail. Implement the contract logic to handle failed calls.
mlukanova (Cudos) acknowledged
Albert Chon (judge) commented:
Would really only happen for malicious/non-standard ERC-20 tokens which could then just be ignored by the orchestrator. No way of getting around doing the transfers for each token.
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 contract does not handle failed external calls inside loops, so a single revert aborts the entire batch.
Impact
A malicious or non-standard token could cause a denial of service for batch transfers, though the judge noted such tokens could be ignored by the orchestrator.
What the attacker needed
Malicious or non-standard ERC-20 token
The fix
The contract should handle failed external calls, for example by catching errors or avoiding multiple calls in one transaction.
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 smart contract sometimes sends tokens to many addresses in one go using a loop. If one of those transfers fails, the whole batch fails, so the operation stops working. This is a denial of service: an attacker could make one transfer fail on purpose to block everyone else.
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.