Hijack implementation contract ownership
Implementation of the upgradeable smart contract LevelOne.sol
contains an initialization function LevelOne::initialize()
, but does not provide the recommended constructor calling _disableInitializers();
in order to prevent a direct calls to initialize()
. That's against the protocol recommendations and allows anyone to hijack ownership of the implementation contract, driving to undesired and vulnerable behavior.
attacker could call all functions restricted with onlyPrincipal
Manual review
Foundry
Add the following test to LevelOneAndGraduateTest.t.sol
.
Add constructor to contract LevelOne
with the following implementation:
This way, the smart contract will prevent possible attacks by malicious users from directly calling the initialization of the smart contract and hijacking its ownership.
The system can be re-initialized by an attacker and its integrity tampered with due to lack of `disableInitializer()`
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.