Error Handling Defensive Mechanisms should be used to prevent unexpected DOS conditions during Cross Chain Messaging. In stakeLink proper error handling mechanism is not used causing DOS in unexpected situations.
According to the Doc's of CCIP , cross-chain messaging can involve a lot of errors in the process which should be properly checked and action must be taken accordingly. These are some of the known Errors mentioned in their Doc's and there may occur some unexpected ones in future.:
https://docs.chain.link/ccip/api-reference/errors
To be safe from unexpected DOS from both known and unknown errors, proper error handling mechanisms should be taken as shown in the below official CCIP docs:
https://docs.chain.link/ccip/tutorials/programmable-token-transfers-defensive
Some of these include adding a processing message function, checking the return messageId for Errors, retrying Failed Messages etc. But as we can see none of these are involved in the present implementation as shown here in RESDLTokenBridge.sol
:
https://github.com/Cyfrin/2023-12-stake-link/blob/main/contracts/core/ccip/RESDLTokenBridge.sol#L113C1-L124C10
and here in SDLPoolCCIPController.sol
:
https://github.com/Cyfrin/2023-12-stake-link/blob/main/contracts/core/ccip/base/SDLPoolCCIPController.sol#L102C1-L110C6
and here in WrappedTokenBridge.sol
:
https://github.com/Cyfrin/2023-12-stake-link/blob/main/contracts/core/ccip/WrappedTokenBridge.sol#L179C1-L190C10
Unexpected DOS due to Errors might be caused which in worst case could lead to Lockage of User Funds as mentioned in CCIP docs as:
Defensive coding is crucial as it enables the recovery of locked tokens and ensures the protection of your users' assets
Manual Review, CCIP Docs
Implement a Proper Error handling mechanism as shown in CCIP's token-transfers-defensive
Docs for receiving and sending of cross chain messages.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.