ThePredicter::makePrediction function, which violates the intended game mechanicsSummary:
The makePrediction function in ThePredicter.sol allows unapproved players to make predictions, violating the intended game mechanics and potentially compromising the integrity of the prediction system.
Vulnerability Details:
The makePrediction function lacks a check to ensure that only approved players can make predictions. This allows any registered player, regardless of their approval status, to participate in the prediction game.
Proof of Concept:
Here is a test proving how a registered user who is not an approvedPlayer can make a prediction. Add this test to ThePredicter.test.sol and run forge test --mt testUnapprovedPlayerCanMakePrediction -vvvv in terminal.
Test output:
Impact:
This vulnerability allows unauthorized participants in the prediction game, which could lead to:
Violation of game rules and mechanics.
Potential financial losses if unapproved players can claim rewards.
Undermining of the system's integrity and fairness.
Possible exploitation through creation of multiple unapproved accounts.
Tools Used:
Forge testing framework, Manual review, AI for troubleshooting
Recommended Mitigation:
Add a check in the makePrediction function to ensure only approved players can make predictions:
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.