First Flight #12: Kitty Connect

First Flight #12: Kitty Connect
Beginner FriendlyFoundryNFTGameFi
100 EXP
View results
Submission Details
Severity: high
Valid

Missing access control in `KittyBridge::bridgeNftWithData`

Summary

KittyBridge::bridgeNftWithData does not have adequate access control, and, consequently, anyone at any time can call this function.

Vulnerability Details

KittyBridge::bridgeNftWithData is supposed to send the encoded NFT data for bridging an NFT from one chain to another. As such, it is supposed to be called only during the bridging process, and only from within KittyConnect::bridgeNftToAnotherChain. However, bridgeNftWithData() lacks the access control neccessary to enforce this and, as a result, anyone at anytime can call this function.

Impact

Anyone, at any time, can call KittyBridge::bridgeNftWithData with an arbitrary (and arbitrarily large) payload. Since sending a message via

messageId = router.ccipSend(_destinationChainSelector, evm2AnyMessage);

entails paying execution fees for the message to Chainlink, an attacker could drain the LINK balance of the KittyBridge contract (that is, provided that another bug is fixed before this one, and KittyBridge approves the router to spend its LINK).

(The impact is contained at this level, since the next step of the bridging process is receipt on the destination chain, and fortunately KittyBridge::_ccipReceive` accepts messages only from allowlisted senders.)

Tools Used

Manual review, Foundry.

Recommendations

Add access control to KittyBridge::bridgeNftWithData:

function bridgeNftWithData(uint64 _destinationChainSelector, address _receiver, bytes memory _data)
external
+ onlyKittyConnect
onlyAllowlistedDestinationChain(_destinationChainSelector)
validateReceiver(_receiver)
returns (bytes32 messageId)
{
...
}
Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

`bridgeNftWithData` misses access control

Support

FAQs

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