NFTBridge
60,000 USDC
View results
Submission Details
Severity: high
Invalid

use of `safeTransferFrom` in `cancelRequest` function could cause loss of nft

Github Links
https://github.com/Cyfrin/2024-07-ark-project/blob/main/apps/blockchain/ethereum/src/Bridge.sol#L254
https://github.com/Cyfrin/2024-07-ark-project/blob/main/apps/blockchain/ethereum/src/Escrow.sol#L79

Summary

The cancelRequest function uses the safeTransferFrom method to return nfts to owners if bridge tx fails. If the caller is a contract that holds nfts but doesn't implement _checkOnERC721Received and their bridge transaction is not successful, they will be unable to call the cancelRequestfunction as it will revert when the bridge attempts to send it back.

Impact

loss of nft

Recommendations

Use the transferFrommethod when returning tokens in the cancelRequestfunction

Updates

Lead Judging Commences

n0kto Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Out of scope

Appeal created

n0kto Lead Judge
10 months ago
n0kto Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Out of scope

Support

FAQs

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