Critical
The graduate()
function in LevelTwo is completely unprotected and can be called by any address, allowing attackers to reset or manipulate contract state during the critical initialization phase. This vulnerability could lead to unauthorized state manipulation, fund theft, and potentially render the entire school system non-functional after upgrade.
LevelTwo includes a graduate()
function marked with reinitializer(2)
, which is intended to initialize the contract state after upgrade:
This function has three critical security issues:
It's completely unprotected - any address can call it, not just the proxy during upgrade
It's currently empty - it doesn't perform any initialization despite being a reinitializer
It doesn't accept any parameters - there's no way to pass state from LevelOne to LevelTwo
The reinitializer(2)
modifier means this function can be called once to initialize the contract's state at version 2. However, without access controls, an attacker could call this function before the legitimate upgrade process occurs, effectively "stealing" the initialization and preventing the proper migration of state from LevelOne.
Moreover, even during a legitimate upgrade, the empty function body means no proper state migration occurs. According to the protocol documentation, LevelTwo should handle the 60% of bursary funds remaining after teacher and principal payments, but there's no mechanism to accomplish this.
Manual code review
Protect and properly implement the graduate function:
Additionally, modify LevelOne's graduateAndUpgrade()
to properly package and transfer state:
All students are graduated when the graduation function is called as the cut-off criteria is not applied.
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.