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

Using `transfer_from()` without confirmation on the recipient

Summary

The protocol utilizes the transfer_from() function, placing the responsibility on the caller to ensure that the recipient can accept ERC721 transfers. However, this confirmation is not adequately enforced.

Vulnerability Details

The ArkProject currently uses the transferfrom() function in the withdrawautofroml1() https://github.com/Cyfrin/2024-07-ark-project/blob/main/apps/blockchain/starknet/src/bridge.cairo#L161 and escrow_deposit_tokens() https://github.com/Cyfrin/2024-07-ark-project/blob/main/apps/blockchain/starknet/src/bridge.cairo#L418 functions within bridge.cairo, as well as in the test scenarios of erc721_bridgeable.cairo. However, this function places the responsibility on the caller to confirm that the recipient is capable of receiving ERC721 transfers, otherwise the NFTs may be permanently lost. Since this confirmation isn't performed, the protocol should implement a mechanism to handle this or switch to using the IERC721::safe_transfer_from function.

More information on this can be found at https://docs.openzeppelin.com/contracts-cairo/0.11.0/erc721

Impact

NFTs can be lost when using transfer_from() because it doesn't include a confirmation mechanism.

Tools Used

Manual Review

Recommendations

Using safe_transfer_from() helps prevent loss, but it's important to note that it introduces an external call, which could potentially create a reentrancy vulnerability.

Updates

Lead Judging Commences

n0kto Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational / Gas

Please, do not suppose impacts, think about the real impact of the bug and check the CodeHawks documentation to confirm: https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity A PoC always helps to understand the real impact possible.

Support

FAQs

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