The graduateAndUpgrade()
function in the LevelOne
contract is vulnerable to premature upgrades and improper access control, allowing the principal to:
Upgrade the contract before the session ends
Bypass student review checks
Withdraw funds prematurely
This could lead to loss of funds, invalid upgrades, or students being graduated without meeting requirements.
Missing Session-End Validation
The function does not enforce that the session has ended (block.timestamp >= sessionEnd)
before allowing an upgrade.
Incomplete Student Review Checks
The function does not verify that:
i. All students have received 4 reviews (1 per week).
ii. All students meet the cut-off score (studentScore >= cutOffScore)
.
Missing Upgrade Validation
No checks ensure that:
i. The new implementation (_levelTwo)
is valid (e.g., not a malicious contract).
ii. The upgrade data (bytes memory) is properly formatted.
Principal/teachers could withdraw funds mid-session
Students could be graduated before reviews complete
Foundry
VS Code
Add Session Validation
Enforce Review Completion
Secure Fund Distribution
Validate Upgrade Target
Use OpenZeppelin’s Upgrade Safety
All students are graduated when the graduation function is called as the cut-off criteria is not applied.
`graduateAndUpgrade()` can be called successfully even when the school session has not ended
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.