stake.link

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

RESDLTokenBridge::ccip router will get less eth than expected due to external call in RESDLTokenBridge.

Summary

Not having a receive() in SDLPoolCCIPController.sol results getting less eth than expected in ccip router.

Vulnerability Details

In RESDLTokenBridge.sol contract an external call is occuring:

messageId = sdlPoolCCIPController.ccipSend{value: fees}(_destinationChainSelector, evm2AnyMessage);

ccipSend() is a payable function of SDLPoolCCIPController contract. In SDLPoolCCIPController::ccipSend() another external call is occuring:

return IRouterClient(this.getRouter()).ccipSend{value: msg.value}(_destinationChainSelector, _evmToAnyMessage);

This time chainlinks Router.sol contract's ccipSend() was called.

Now, when SDLPoolCCIPController::ccipSend() is called by sending ether as it is a payable function the sent eth is added as eth balance of the contract. But this - IRouterClient(this.getRouter())::ccipSend() external call requires the exact msg.value which was sent to the SDLPoolCCIPController contract. We know external calls requires gas to execute, this gas cost will be deducted from the contract's eth balance, so when IRouterClient(this.getRouter())::ccipSend() is called the router will get less ether than expected which may revert the transaction if it is less than or equal to feeAmount is router contract:

if (msg.value < feeTokenAmount) revert InsufficientFeeTokenAmount();

Impact

The whole transaction chain i.e sdlPoolCCIPController.ccipSend() -> IRouterClient(this.getRouter()).ccipSend() will revert.

Tools Used

Manual analysis.

Recommendations

Add a receive() in SDLPoolCCIPController.sol contract so that ether can be sent to this which will cover gas fees.

Updates

Lead Judging Commences

0kage Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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