The contract allows users to join the event multiple times without validation, causing their shares to be counted multiple times in the winner calculation. This results in an inflated totalWinnerShares value, which directly reduces the payout amount for all winners. The normal behavior should be that each user's shares are counted only once, regardless of how many times they call joinEvent.
The vulnerability exists in the joinEvent function where user addresses are appended to usersAddress without checking for duplicates:
Likelihood:
The vulnerability will occur whenever a user calls joinEvent multiple times during the event registration period.
This is trivially exploitable by any user with basic knowledge of smart contracts.
Impact:
Winners receive significantly reduced payouts (up to 50% reduction if a user joins twice).
The contract's financial integrity is compromised as the actual payout amount is mathematically reduced by the number of duplicate joins.
Deploy the attacker contract with the BriVault address. Ensure the attacker has deposited assets and joined the event once. Then, call joinEvent multiple times before the event starts. Each call pushes the attacker’s address again into usersAddress. When the admin sets the winner (which matches the attacker’s chosen country), _getWinnerShares() iterates over all entries in usersAddress, counting the attacker’s shares once per duplicate entry. This inflates totalWinnerShares, reducing the payout for all winners—including the attacker—by a factor proportional to the number of duplicates.
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.