The SystemConfig::initialize & the TokenManager::initializefunctions are not protected against multiple calls. Although it is restricted to the owner, it lacks the initializer modifier, which is crucial for preventing re-initialization.
This oversight could lead to unexpected behavior and potential system disruption if the function is called more than once, either accidentally or maliciously.
The vulnerable initialize function in SystemConfig.sol:
This function can be called multiple times by the owner, potentially resetting critical system parameters.
If the initialize function is called multiple times, it could reset critical system parameters such as basePlatformFeeRate and baseReferralRate. This could disrupt the entire system's economic model, potentially leading to:
Incorrect fee calculations
Unexpected changes in referral rates
Inconsistent system state
Potential financial losses for users or the protocol
While the likelihood of exploitation is reduced due to the onlyOwner modifier, the potential impact remains significant, especially in scenarios involving contract upgrades.
Manual Review
To mitigate this issue:
Import the Initializable contract from OpenZeppelin:
Make SystemConfig inherit from Initializable:
Add the initializer modifier to the initialize function:
These changes ensure that the initialize function can only be called once, even by the owner, providing robust protection against accidental or malicious re-initialization.
Invalid, can only be initialized by admin, which are trusted per contest READ.ME. So this would take a malicious admin to reinitialize contracts.
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.