BriVault::joinEvent allows multiple team joins with the same balance, inflating totalWinnerShares.Each user should assign their shares to a single team, so their balance cannot be reused to credit multiple teams.
joinEvent() does not prevent re-entries. Each call overwrites userToCountry[msg.sender] with the latest team, writes userSharesToCountry[msg.sender][countryId] = balanceOf(msg.sender) for every team joined, and pushes msg.sender to usersAddress every time. As a result, the denominator totalWinnerShares can be inflated with duplicates; if the user's last team is not the winner, they cannot withdraw, but they have inflated the denominator used in:
Likelihood: High
It is trivial to loop joinEvent() before the tournament starts, betting on all countries as many times as desired with the same balance.
Impact: High
When the owner sets the winner, _getWinnerShares() sums duplicate entries and inflates totalWinnerShares. This causes legitimate winners to receive less than they should and leaves leftover tokens locked in the contract.
The test shows that a user can call joinEvent() multiple times with the same balance, inflating totalWinnerShares.
This causes legitimate winners to receive less in withdraw(), while the attacker cannot withdraw because their last team is not the winner.
Add a mapping to track users who have already joined.
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.