Description: The graduateAndUpgrade() function does not enforce that all students have received their full cycle of reviews before allowing a system upgrade to LevelTwo. According to the intended lifecycle, each student should be reviewed once per week, for a total of 4 reviews across a 4-week session. However, the current implementation contains no conditional check to verify whether any student has received fewer than 4 reviews.
As a result, the principal can invoke graduateAndUpgrade() even if the session is incomplete or some students have been reviewed less than 4 times.
Impact: Allowing an upgrade before students have completed their full 4-week review cycle undermines the integrity of the system’s evaluation phase. Specifically:
Students may be prematurely transitioned to the next level without a full assessment.
Review-based scoring logic becomes inconsistent.
Any logic in LevelTwo relying on studentScore or reviewCount may be invalid or misaligned.
Proof of Concept: Paste the following test in LevelOneIAndGraduateTest.t.sol
Logs:
Recommended Mitigation: Enforce the invariant by validating that all students have received at least 4 reviews before allowing an upgrade:
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.