The ScoreBoard
contract allows unauthorized players to make or alter predictions on behalf of other players. This can result in incorrect scoring, zeroing out player scores, and manipulating the reward distribution to favor the attacker.
This can lead to score manipulation, potential reward theft, and compromise the integrity of the prediction system.
The ScoreBoard::setPrediction()
function at line 61 allows any user to change another player's prediction, this function does not have proper access control, enabling malicious player to manipulate the predictions of other players, allowing any player to call it and modify predictions for any other player. This can be exploited in several ways:
Changing a user's prediction from correct to incorrect
Setting a player's score to 0 by making their predictions pending
Increasing an attacker's share of the reward by changing other players' predictions to incorrect ones
Add the following to ThePrediter.test.sol
test file:
High. Reasons:
Integrity Compromise: The prediction system's integrity is completely undermined, as predictions can be arbitrarily changed.
Financial Loss: Players can lose potential rewards due to malicious manipulation of their predictions.
Score Tampering: Attackers can gain an unfair advantage by manipulating others' predictions to increase their own reward share, by doing this players' scores can be unfairly altered, leading to a loss of points or incorrect scores.
Trust Issues: The overall trust in the game system is compromised, as potentially causing users to abandon the system as scores and rewards can be manipulated by unauthorized players.
Manual code review
Foundry (for running test cases)
Implement Access Control: Modify the ScoreBoard::setPrediction()
function to only allow calls from the prediction owner or authorized contract functions.
Use Modifiers: Implement and use modifiers to check permissions before allowing prediction changes.
Event Logging: Implement event logging for all prediction changes to provide transparency and aid in detecting unauthorized changes.
Time-lock Mechanism: Consider implementing a time-lock mechanism that prevents changes to predictions after a certain point.
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.