There's no check to prevent an infinite loop if the list is circular in _white_list_collection.
The loop in question is this one:
This loop is intended to find the last element in the whitelist. It does this by traversing the linked list, moving from one element to the next until it either finds an element with no next pointer (i.e., next.is_zero()
) or an inactive element.
The vulnerability arises because there's an assumption that the list will eventually end (either with a zero address or an inactive element). However, if due to a bug or malicious action, the list becomes circular (i.e., the last element points back to an earlier element in the list), this loop would continue indefinitely.
For example, if we have a list A -> B -> C -> A and all elements are active, the loop would never terminate. It would keep cycling through A, B, and C forever.
The infinite loop could lead to a denial of service (DoS).
Manual review
Implement a check to detect cycles in the linked list.
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.