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

`get_white_listed_collections` function breaks the loop when it encounters a disabled collection

Vulnerability Details

if !enabled {
break;
} else {
white_listed.append(current);
current = next;
}

in the get_white_listed_collections function in the bridge.cairo , there is a logic bug related to how the function handles disabled collections in the whitelist. The function is designed to return a list of whitelisted collections, but it prematurely breaks the loop when it encounters a disabled collection.

If a disabled collection is encountered in the middle of the list, the function will stop iterating and miss any subsequent enabled collections. This could lead to an incomplete list of whitelisted collections being returned.

Impact

  1. Inconsistent whitelisting: Some valid, whitelisted collections might be excluded from the returned list.

  2. Denial of service: Users might be unable to bridge tokens from legitimately whitelisted collections.

PoC :

  1. Admin whitelists collections A, B, C, D in that order.

  2. Admin disables collection B (but keeps it in the list).

  3. When get_white_listed_collections is called, it returns only [A], missing C and D.

  4. Users trying to bridge tokens from collections C or D will be denied, even though these collections are actually whitelisted.

Tools Used

Manual review

Recommendations

To fix this, the function should continue iterating even when it encounters a disabled collection, only appending enabled collections to the return list.

Updates

Lead Judging Commences

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

Support

FAQs

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