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

Cannot disable whitelisted elements

Summary

Incorrect pointer update in _white_list_collection function leads to out of gas error when collection is disabled

Vulnerability Details

In _white_list_collection function, there is a mistake in the loop which handles disabling a collection in the whitelist. The loop doesn't update the prev pointer at end of the loop. Due to this if the function tries to disable any collection after 2nd position, the transaction will fail due to out of gas error.

https://github.com/ArkProjectNFTs/bridge/blob/main/apps/blockchain/starknet/src/bridge.cairo#L524

POC

Impact

Cannot disable whitelisted collection after 2nd position in linked list

Tools Used

Manual review

Recommendations

Add prev = next at end of loop

Updates

Lead Judging Commences

n0kto Lead Judge 9 months ago
Submission Judgement Published
Validated
Assigned finding tags:

finding-L2-unwhitelist-from-third collection-impossible

Likelyhood: High, owner can only unwhitelist the 2 first collections. Impact: Medium/High, owner has to empty the list to remove any collection, and replace all the new ones.

Support

FAQs

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