The ThePredicter::makePrediction function is designed to be called by addresses within the player's array. However, any address can currently call this function and submit a prediction.
The makePrediction function is intended to be invoked exclusively by addresses within the players' array to submit predictions. However, it currently lacks a validation check to ensure the caller is indeed a player, allowing any address to submit a prediction without being approved by ThePredicter::approvePlayer function. This vulnerability can disrupt the competition's integrity, exceed the 30-player limit by allowing unrestricted calls, and result in critical issues during prize distribution at the competition's conclusion.
Place the following test case in ThePredicter.test.sol
I created a random address "anyone," and called the ThePredicter::makePrediction function directly without approving the address "anyone" as a player through the ThePredicter::approvePlayer function.
The test case is passing meaning any random address can make a prediction that goes against the intended functionality of the protocol
To verify that the address "anyone" was not included in the players array, I added a getter function to the contract to retrieve all the addresses in the players array.
As expected, the verification was successful because the function returned an empty array.
Unauthorized users can submit predictions, undermining the fairness of the competition. This disrupts the intended structure where only registered and approved players can participate.
The system is designed to have a maximum of 30 players. Allowing anyone to call the function can easily surpass this limit, leading to potential logistical and operational issues within the competition.
The inclusion of unauthorized predictions can skew the results, causing critical issues during the prize distribution phase. Legitimate players who followed the registration process might be unfairly disadvantaged or deprived of their rightful rewards.
Manual Review
Add a specific error, error ThePredicter__NotAPlayer(), within an if condition in your ThePredicter::makePrediction function to validate that the caller is a player.
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.