The loop in bridge#_white_list_collection
function does not update pre
to next
, results in an infinite loop when attempting to remove a collection from the whitelist.
The function iterates through self.white_listed_list
to locate the target collection
. However, after each iteration, prev
is not updated to next
. This causes the loop to continuously re-evaluate the same element, preventing the removal operation from completing.
For example, given the white_listed_list
structured as collection01 -> collection02 -> collection03 -> collection04
, removes collection03
:
Iteration 1: prev
=> collection01, next
=> collection02. Condition next == collection
is false, loop continues.
Iteration 2: prev
=> collection01, next
=> collection02. Condition next == collection
is false, loop continues.
This pattern repeats, causing an infinite loop and preventing the function from progressing past the first element.
Change below line for starknet/src/tests/bridge_t.cairo
Run snforge test
:
Besides the first and second collection, unable to remove other collections from whitelist.
vscode, starknet-foundry
Add prev = next
at the end of loop.
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.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.