The function ScoreBoard.setPrediction
allows any user to change any prediction of any player.
The function ScoreBoard.setPrediction
allows any user to change any prediction of any player.
It seems that the problem araises because this function was made to be called by ThePredicter
when a player calls ThePredicter.makePrediction
, as well as to be called directly by the Players to change an existing prediction. That is why the function accepts a player address a parameter. This address is not checked against the caller, so the parameter can be set to the address of any player and as a result any caller can change any player's prediction.
The following PoC shows how to exploit the vulnerability:
Any user can change any player's prediction, compromising the integrity of the system.
Foundry
Verify the caller address in ScoreBoard.setPrediction
. If the address is from ThePredicter
allow any player's address to be used as a parameter. If the caller is not ThePredicter
the address passed as a parameter should be the same as msg.sender
.
Alternatively, make a copy of the function that does not accept an address as a parameter, and uses msg.sender
instead. And add the modifier onlyThePredicter
to the original version of the function.
setPrediction has no access control and allows manipulation to Players' predictions.
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.