Attacker can deploy and front-run a new implementation of the contract and set themself as the principal.
The initialize() function in LevelOne contract can be called by anybody since it doesn't have access control. Thus, an attacker can take control of the contract by setting himself as the principal.
Also,
Here's the attacker deploying a new implementation & proxy separately, setting themselves as the principal and taking over the contract.
Here's an instance of the attacker front-running:
An attacker could monitor the mempool, front-run the initialization, and set themselves as principal.
Any address can be the initializer, thereby rendering the contract unusable
Foundry
VS Code
Import the import {OwnableUpgradeable} contract from OpenZeppelin and add __Ownable_init(_principal) in the initialize function. Include address private _deployer as a variable at the State level. Then add the _disableInitializers() constructor and initialize the _deployer.
Lastly, add the statement require(msg.sender == _deployer, "Only deployer can initialize") to the initialize function.
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.