stake.link

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

`_ccipReceive` missing check for whitelisted sender.

Vulnerability Details

_ccipReceive function in WrappedTokenBridge.sol contract is missing check for whitelisted sender to receive message from, therefore tokens can be send to non-supported destination.

https://github.com/Cyfrin/2023-12-stake-link/blob/549b2b8c4a5b841686fceb9c311dca9ac58225df/contracts/core/ccip/WrappedTokenBridge.sol#L234

Impact

Tokens can be lost.

Tools Used

Manual review

Recommendations

Consider to use a mapping to check that sender is whitelisted , or use _verifyCCIPSender function as in SDLPoolCCIPController.sol contract.

function _ccipReceive(Client.Any2EVMMessage memory _message) internal override {
++ _verifyCCIPSender(_message);
if (_message.destTokenAmounts.length != 1) revert InvalidMessage();
address tokenAddress = _message.destTokenAmounts[0].token;
...
}
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.