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

NFT may loss when transfer from L1 to L2

code: https://github.com/Cyfrin/2024-07-ark-project/blob/273b7b94986d3914d5ee737c99a59ec8728b1517/apps/blockchain/ethereum/src/Bridge.sol#L117-L118

https://github.com/Cyfrin/2024-07-ark-project/blob/273b7b94986d3914d5ee737c99a59ec8728b1517/apps/blockchain/ethereum/src/sn/Cairo.sol#L8

Summary

When transfer from to L1 to L2, the NFT may loss.

Vulnerability Details

The users provided ownerL2 type: type snaddress is uint256. However, this may create an issue because the account primitive type in Cairo is the felt within the range 0 < x < P, which P = 2^251 + 17 * 2^192 + 1 which less than 2**256.

So the users provided ownerL2 may greater than felt, but the ownerL2 may convert to an unexpected account in starknet.

Impact

The NFT may loss when transfer from L1 to L2.

Tools Used

vscode, Manual Review

Recommendations

Add check ownerL2 should less than P when calling the depositTokens function.

Updates

Lead Judging Commences

n0kto Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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