The fundContest() and closeContest() functions accept an index parameter or address without validating that it corresponds to a valid contest. This can lead to invalid calls or calls to wrong contracts.
In fundContest(), the index is used directly to access the contests array without bounds checking. If the index is out of bounds, the transaction will revert, but a more graceful check would be better.
In closeContest(), the contest address is passed directly to Pot(contest).closePot() without verifying that this address is actually a valid contest created by the ContestManager.
Likelihood: High - The owner may accidentally pass wrong index or address.
Impact:
fundContest() with invalid index will revert (out of bounds)
closeContest() can be called on arbitrary addresses that have a closePot() function
No validation that the contest was created by this ContestManager
Potential for interacting with malicious contracts
This POC demonstrates that fundContest() and closeContest() accept invalid inputs without proper validation, causing reverts or allowing calls to arbitrary addresses.
Adding bounds checks for array indices and validating that contest addresses belong to this ContestManager prevents invalid operations and ensures only legitimate contests are managed.
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.