The LevelTwo::graduate
function is marked with the reinitializer(2)
modifier and is publicly accessible without any access control. This means any external user can invoke it once, consuming the contract's version 2 reinitialization slot. As a result, the legitimate contract owner (e.g., the principal) may be permanently prevented from executing critical upgrade-time logic, such as setting new variables or distributing funds.
Unrestricted Access
Since the function is public
and has no onlyPrincipal
or equivalent modifier, any address can call it.
Consumes reinitializer(2)
The reinitializer(2)
modifier ensures that this function can only be executed once. If a malicious user calls it first, the contract is marked as "initialized to version 2", blocking any future reinitializer(2)
logic.
Breaks Upgrade Safety
This may prevent proper initialization of new state variables or distribution of resources introduced in LevelTwo, leading to broken business logic and stuck funds.
Denial of Initialization: Legitimate parties are blocked from performing upgrade-time setup.
Potential Logic Incompleteness: Contract may remain in a partially-upgraded, unusable state.
System Integrity Loss: Future UUPS upgrades or state transitions may silently fail.
Manual Code Review
Add appropriate access control (e.g., onlyPrincipal
) to restrict graduate()
execution to authorized parties only:
Alternatively, consider making graduate()
internal
if it is only intended to be called within another controlled flow.
The system doesn't implement UUPS properly.
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.