Non approved players can make predictions and withdraw rewards. If the attacker makes a correct prediction using ThePredicter.makePrediction
function they will be able to steal funds from the contract by calling the ThePredicter.withdraw
function
The functions ThePredicter.makePrediction
and ThePredicter.withdraw
do not validate that the caller is an approved player. This enables any user to make predictions if the predictions are correct to withdraw funds. Moreover, the malicious user does not have to pay an entrance fee to do this, just the prediction fee. There is no limit to the amount of users that can do this, which can drain the contract's funds, leaving valid players unable to withdraw their rewards.
The following PoC shows how this vulnerability can be exploited:
Non players can participate in predictions and claim rewards, potentially draining contract's funds
Foundry
Add validations to ThePredicter.makePredictor
and ThePredicter.withdraw
functions to ensure the callers are approved players.
Optionally:
Add events for new predictions and withdrawals to have better visibility of user actions
makePrediction has no access controls and any unapproved user can make predictions causing an incorrect calculation and distribution of rewards.
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.