ContestManager::closeContest does not check that param address contract is an approved contest, and that address is used to call ContestManager::_closeContest, opening potential to calls to unapproved contractsContestManager::closeContest does not check that param address contract is an approved contest, and that address is used to call ContestManager::_closeContest, opening potential to calls to unapproved contracts. The call can happen so long as the unapproved contract has a function with the same function signature as Pot::closePot.
Likelihood:
This will happen any time the address of a contract is passed to ContestManager::closeContest that has a function that matches the function signature of Pot::closePot.
Impact:
The impact is that a given address is not checked as a valid contest, which means that a contract using the same function signature as Pot::closePot can be called, opening the door to malicious activity.
We define a malicious contract with the same function signature as Pot::closePot, and which targets ContestManager.
Our test function deploys the malicious contract fakePot, and the user calls ContestManager::closeContest with the param being the address of fakePot. This calls ContestManager::_closeContest, which calls fakePot's function MaliciousContract::closePot, which logs "fake closePot called", showing that the function runs. The test function passes.
We recommend that a mapping of addresses to booleans be created to define if an address is a contest in ContestManager.
The mapping will allow for constant-time look-up to verify that a given address is a contest. This mapping can be updated in ContestManager::createContest:
We recommend that a custom error be added to ContestManager:
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.