This report identifies a critical vulnerability in the setPrediction()
function within the ScoreBoard.sol
contract. The current implementation allows players to change their predictions after each match result is known, due to the lack of proper access control in the setPrediction()
function. This undermines the integrity and fairness of the betting system.
The setPrediction()
function, which sets a player's prediction for a given match, lacks adequate access control. As a result, players can alter their predictions after the match results have been entered by the Organizer. This allows for unfair manipulation of the game, as players can retroactively change their predictions to match the actual results, ensuring they always score points.
Fairness Compromised: Players can manipulate their predictions to ensure they always score points, compromising the fairness of the game.
Integrity Undermined: The betting system's integrity is undermined, as the scoring no longer reflects players' actual predictions made before the match.
ThePredicter.test.sol
and run with forge t --mt test_Prediction_can_be_Manipulated_After_Result -vv
manual review/Foundry
1) Access Control: Restrict the function so that only authorized addresses, such as thePredicter.sol, can call it.
2) Time Restriction: Ensure that predictions can only be set or changed before the match starts. enforcing the time it was called was before the match
The lack of access control and time restrictions in the setPrediction()
function poses a critical risk to the integrity and fairness of the betting system. By implementing the suggested controls, this vulnerability can be mitigated, ensuring that predictions are made and locked in before the match starts, maintaining a fair and trustworthy betting protocol.
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.