stake.link

stake.link
DeFiHardhatBridge
27,500 USDC
View results
Submission Details
Severity: low
Invalid

Use external call on loops may fail because run out of gas

Summary

Use external call on loops may fail and make protocol on DOS state for a certain time because run out of gas

Vulnerability Details

File : SDLPoolCCIPController.sol
for (uint256 i = 0; i < _tokens.length; ++i) {
IERC20 tokenToTransfer = IERC20(_tokens[i]);
tokenToTransfer.safeTransfer(_receiver, tokenToTransfer.balanceOf(address(this)));
}
File : SDLPoolCCIPControllerSecondary.sol
for (uint256 i = 0; i < numRewardTokens; ++i) {
rewardTokens[i] = _message.destTokenAmounts[i].token;
IERC20(rewardTokens[i]).safeTransfer(sdlPool, _message.destTokenAmounts[i].amount);
}

Impact

External calls may fail because run out of gas

Tools Used

Manual review

Recommended Mitigation

  1. Avoid combining multiple calls in a single transaction, especially when calls are executed as part of a loop.

  2. Always assume that external calls can fail.

  3. If possible, use pull over push strategy for external calls.

Updates

Lead Judging Commences

0kage Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.