If last match result is set first by the organizer, a malicious player could withdraw funds from the contract even if they are not eligible for rewards. If this happens, the organizer will not be able to withdraw prediction fees and honest players will not be able to withdraw their rewards.
The functions ThePredicter.makePrediction
and ScoreBoard.setPrediction
allow players to set results to Pending
status. If a user sets results to Pending
and the organizer mistakenly sets the result of the last match before the other matches, then the withdraw function will work and since all other matches results are in Pending
status, the user will be able to claim rewards as if their predictions where correct.
The explotaition of the vulnerability would be complex, since it needs a specific behavior from the organizer, and if that does not happen the attacker will lose funds making the attack setup.
In case the vulnerability is exploited, there will not be enough funds for all of the honest players to withdraw their rewards, and the organizer will not be able to withdraw the prediction fees, because the function will hit an underflow and revert.
The following PoC shows how the vulnerability could be exploited:
Withdrawal of funds for players not eligible for rewards
Prevent organizer from withrawing prediction fees
Prevent honest users from withdrawing rewards
Foundry
Make the functions ThePredicter.makePrediction
and ScoreBoard.setPrediction
revert if the result specified in the parameter is Pending
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.