A user should only be able to call joinEvent once to register their stake for a single country.
However, The function lacks a check to see if a user has already joined. An attacker can call joinEvent repeatedly, assigning their entire share balance to multiple countries. This inflates the totalWinnerShares calculation, causing withdrawals for legitimate winners to be drastically reduced.
Likelihood:
A legitimate user who joins one team (e.g., country 0) and later changes their mind to join another (e.g., country 1) will call joinEvent again.
The function allows this change, but it fails to remove the user's original entry. It simply adds them again, causing their full share balance to be counted for both teams (or all teams they've ever picked).
A threat actor can also intentionally exploit this cheaply, calling joinEvent for all 48 countries to guarantee their shares are part of the winning pool, ensuring maximum dilution.
Impact:
The totalWinnerShares value becomes massively inflated. When legitimate winners withdraw, their payout is divided by this huge number, permanently locking their funds as they can only claim a fraction of their due.
This affects all participants in the winning pool, including the users who accidentally triggered the bug.
Attackers (user2, user3) call joinEvent multiple times for different countries. A legitimate user (user1) joins only once. When the winner is declared (country 0), the _getWinnerShares function over-counts the shares from user2 and user3, massively inflating the total. This causes user1's withdrawal to be significantly diluted. Instead of receiving their full ~19.7e share, they only receive ~8.44e, as shown in the logs.
A hasJoined mapping must be added to prevent users from joining more than once.
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.