The issue happens here:
(src/LevelOne.sol#125–141)
Lack of onlyProxy
or constructor lock: No onlyProxy
guard and no _disableInitializers()
in a constructor, so anyone can call initialize()
on the implementation or proxy first.
Attacker as principal: Once called, the attacker becomes principal
and satisfies onlyPrincipal
, enabling them to call upgradeToAndCall
on the proxy to any malicious implementation.
Anyone can call initialize on the logic contract, and destruct the contract.
Add the following test to LevelOneAndGraduateTest.t.sol
:
Slither
Foundry
Manual Review
1. Add a constructor to ensure initialize
cannot be called on the logic contract
2. Add onlyProxy
modifier to initialize
so it can only be called via the proxy
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.