Closed c4-submissions closed 12 months ago
141345 marked the issue as insufficient quality report
bot race known issue L-02
The Warden's submission entails validation of input addresses in constructors that is an exact match of bot issue L-23.
alex-ppg marked the issue as unsatisfactory: Out of scope
Lines of code
https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/MinterContract.sol#L132,https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/NextGenCore.sol#L109,https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/RandomizerNXT.sol#L27,https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/RandomizerRNG.sol#L32,https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/RandomizerVRF.sol#L44,https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/AuctionDemo.sol#L39
Vulnerability details
Impact
In the
NextGenCore
contract constructor, there is no check that a valid admin contract is set usingNextGenAdmins::isAdminContract()
.If the contract address in the
_adminsContract
constructor is set incorrectly, it is not possible to call admin functions in the contract, which will cause the contract to become inoperable.It is impossible to change the address of the contract after deployment, because
NextGenCore::updateAdminContract()
uses theFunctionAdminRequired()
modifier, which calls the current admin contract. But since we have it specified incorrectly, it is impossible to access its functions.This leads to the problem that if you initially set an incorrect address, it is impossible to change it later. The functions cannot be performed from the admin role.
This problem is found in contracts:
Proof of Concept
Deployer specifies the wrong contract address in the constructor argument
_adminsContract
, which is notINextGenAdmins
.After the deployment, it tries to call a function
but triggers the
FunctionAdminRequired()
modifier, which checks for access to that function withadminsContract
set:Of course
FunctionAdminRequired
returns an error because it cannot call theadminsContract
contract functions due to a non-existent address.To run the test, change
/hardhat/scripts/fixturesDeployment.js
to a random address (line 26)Add this code to
/hardhat/nextGen.test.js
and run test (npx hardhat test --grep "Change admin"
)Tools Used
Manual analysis, Hardhat, VS Code
Recommended Mitigation Steps
Check values in the constructor
Assessed type
Invalid Validation