The updateAdminsContract(address)
function in RandomizerNXT contract doesn't check if the proposed new admin address implements isAdminContract()
#129
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
edited-by-warden
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/hardhat/smart-contracts/RandomizerNXT.sol#L45-L46
Vulnerability details
Bug Description
RandomizerRNG and RandomizerVRF contracts execute a check in
updateAdminContract(address)
function to make sure the newly proposed admin address corresponds to a contract that implementsisAdminContract()
, which only returns true. AsupdateAdminContract()
uses a one step procedure to update the value ofINextGenAdmins private adminsContract
variable, this check is important to make sure the address passed toupdateAdminContract()
indeed corresponds to an implementation ofNextGenAdmins
contract.Impact
Here is the check :
This line isn't present in RandomizerNXT. Therefore, there is no check on the address passed and what contract it corresponds to. Moreover, as all update functions in RandomizerNXT use
FunctionAdminRequired
modifier, if a wrong address is passed, they will all fail as the modifier execution will revert. In that situation, it will be necessary to redeploy RandomizerNXT contract.Tools Used
Manual
Recommended Mitigation Steps
Add the same check as in other Randomizer contracts to make sure the new
adminsContract
variable will be an adminsContract instance and will therefore be callable :Assessed type
Access Control
The text was updated successfully, but these errors were encountered: