The KittyBridge contract facilitates token transfers to another chain. To achieve this, the KittyConnect contract invokes KittyBridge::bridgeNftWithData. However, to bridge tokens between chains using CCIP, the KittyBridge must pay a fee in LINK tokens. This payment necessitates approval for LINK token transfer from KittyBridge to the CCIP router, which is currently absent.
The vulnerability resides within the KittyBridge contract. In the bridgeNftWithData function, Router::ccipSend is called without prior approval for LINK token transfer.
The CCIP Router contract attempts to levy a fee from the KittyBridge for dispatching CCIP messages in LINK. However, this attempt fails due to the lack of approval from KittyBridge for the transfer.
The KittyBridge::bridgeNftWithData function consistently reverts due to insufficient allowance.
Manual review and forge were employed.
To replicate this issue, utilize the provided forge script below (save it in the file script/MintCatAndBridge.s.sol):
Ensure to set the appropriate values for RECEIVER_PK, sepolia-rpc-url, and adjust addresses as necessary. Running this script will consistently fail:
Insert the following line before sending the CCIP message in the KittyBridge::bridgeNftWithData function:
This addition ensures that KittyBridge appropriately approves the transfer of LINK tokens before dispatching CCIP messages, thereby rectifying the identified issue.
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.