The _getWinnerShares() function iterates through the entire usersAddress array without any gas limit protection. Since users can be added to this array multiple times (as shown in the previous finding), and there's no limit on the number of participants, a malicious actor could create thousands of deposits and join events to bloat the array. This would cause the setWinner() function to run out of gas and revert, effectively locking all funds in the contract permanently as no one could withdraw without the winner being set.
Complete denial of service preventing winner declaration and permanent fund lock.
All participants' funds become irretrievable as the withdraw function requires the winner to be set first.
The owner cannot set the winner due to gas limits, creating a deadlock situation.
Implement a pull-based winner share calculation pattern or use pagination:
The _getWinnerShares() function is intended to iterate through all users and sum their shares for the winning country, returning the total.
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.