cancelParticipation() Doesn't Reset joinEvent() State Causing Direct Financial Loss to Legitimate WinnersExpected beahviour: when a user cancels participation, the following is meant to happen:
When user cancels, stakedAsset is reset and shares are burned
userToCountry[msg.sender] is cleared
userSharesToCountry[msg.sender][countryId] is cleared
User is removed from usersAddress[]
numberOfParticipants is decremented
totalParticipantShares is decremented
Actual Behaviour:
When user cancels, stakedAsset is reset and shares are burned
BUT userToCountry[msg.sender] is NOT cleared
userSharesToCountry[msg.sender][countryId] is NOT cleared
User is NOT removed from usersAddress[]
numberOfParticipants is NOT decremented
totalParticipantShares is NOT decremented
Location: cancelParticipation() function (lines 275-289)
Likelihood: High: natural users may cancel participation for any reason leading to the vulnerability
Impact:
If user cancels then deposits again and joins different country:
Old country selection remains in mappings
User appears in usersAddress[] twice (if they rejoin)
_getWinnerShares() may count old country selection
Inflated participant counts
Incorrect winner share calculations
Example:
Alice deposits 10 ether, gets 9.85 shares, joins country 10
Bob deposits 10 ether, gets 9.85 shares, joins country 10
Alice cancels (does not rejoin) → shares burned, but stale data remains
Country 10 wins
Results:
Expected winner shares: 9.85 (only Bob)
Actual winner shares: 19.7 (Bob + Alice's stale 9.85)
Inflation: 100% (doubled)
Bob's expected withdrawal: 9.85 ether (100% of vault)
Bob's actual withdrawal: 4.925 ether (50% of vault)
Bob's loss: 4.925 ether (50% loss)
Locked funds: 4.925 ether (permanently stuck)
clear joinEvent stae and clear all mappings for the user
CancelParticipation burns shares but leaves the address inside usersAddress and keeps userSharesToCountry populated.
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.