ScoreBoard
contract contains a critical vulnerability due to the lack of access control in the setPrediction
function. This function allows any external entity to set predictions for any player, which can be exploited to manipulate predictions and potentially disrupt the intended functionality of the contract.
The setPrediction
function in the ScoreBoard
contract allows anyone to call it and set predictions for any player without any restrictions. This lack of access control means that malicious actors can manipulate predictions, leading to incorrect scores and potential financial losses
https://github.com/Cyfrin/2024-07-the-predicter/blob/main/src/ScoreBoard.sol#L61
Function Accessibility: The setPrediction
function is declared as public
, which means it can be called by any external address.
Lack of Modifier: There is no access control modifier (like onlyOwner
or onlyThePredicter
) to restrict who can call this function.
Manual Code Review
Add an access control modifier to the setPrediction
function to ensure only authorized entities can call it. For example, using the onlyThePredicter
modifier to restrict access to the ThePredicter
contract.
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.