The system allows the principal to upgrade the contract and distribute wages before students meet the required number of reviews or complete minimum enrolment duration. This undermines the system's integrity and trust model, potentially leaving students ungraded and financially disadvantaged.
The LevelOne.sol::graduateAndUpgrade function lacks validation for key invariants: it does not check whether students have received the required number of reviews, nor does it enforce a minimum time period after enrolment before the system can be upgraded.
As a result, the principal can prematurely trigger an upgrade and release payments to teachers and themselves, bypassing the graduation requirements. This violates the logical flow of the system, where graduation should precede both contract upgrades and wage disbursements.
Relevant code:
Impact: High – Premature upgrades and payouts can result in students not receiving their expected reviews despite having paid fees, severely eroding trust in the system and breaking the educational logic enforced by the contract.
Likelihood: High - The absence of critical safeguards (such as review count and time-based checks) enables both accidental misuse and deliberate exploitation of the system. Even with a trusted principal, the ease of triggering an upgrade and wage disbursement in a single call makes this vulnerability a significant risk.
Manual review of the GraduiateAndUpgrade function
Foundry test
Proof of Concept:
The following test demonstrates that a student can graduate without receiving any reviews, and wages are paid out nonetheless::
Add a check in GraduateAndUpgrade function to ensure that each student has received the required number of reviews, i.e. 4, before allowing graduation and wage disbursement.
Introduce a minimum delay, i.e. 4 weeks, after student enrolment before the contract can be upgraded to ensure a fair and complete educational process.
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.