The LevelOne and LevelTwo contracts are missing the _disableInitializers() call in their constructors and initialization functions. This omission could allow malicious actors to re-initialize the contracts after deployment or upgrade, potentially resetting or modifying critical state variables.
An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke the _disableInitializers() function in the constructor to automatically lock it when it is deployed
Contract state variables can be reset or modified after initial deployment
Critical parameters like principal, schoolFees, and usdc address can be altered
Contract upgrade security can be compromised
Business logic and financial operations could be disrupted
Foundry, Manual review
Add _disableInitializers()
in the constructor of both contracts
for LevelOne.sol, modify the initialize function:
For LevelTwo.sol, implement proper initialization logic:
https://docs.openzeppelin.com/contracts/4.x/api/proxy#Initializable
https://docs.openzeppelin.com/contracts/4.x/api/proxy#UUPSUpgradeable
https://docs.openzeppelin.com/upgrades-plugins/1.x/proxies
The vulnerability affects both the initial deployment and upgrade process
The issue is particularly critical given the financial nature of the contract (handling USDC)
The attack could be executed by any address since there's no protection against re-initialization
This vulnerability could be combined with other attacks to maximize impact
The system can be re-initialized by an attacker and its integrity tampered with due to lack of `disableInitializer()`
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.