The graduateAndUpgrade
function in the LevelOne
contract fails to verify that all students have received exactly 4 reviews before upgrading, violating the invariant that "System upgrade should not occur if any student has not gotten 4 reviews." This logic error allows premature upgrades, risking incorrect student graduations and system instability.
The graduateAndUpgrade
function does not check if each student in listOfStudents
has a reviewCount
of 4, as tracked in the giveReview
function. The invariant requires 4 reviews per student before upgrades, but the function proceeds with payouts and upgrades regardless of review counts. This allows the principal to call graduateAndUpgrade
early (before 4 weeks) or with incomplete reviews. A malicious principal could exploit this to graduate students with fewer or no reviews, bypassing academic standards. Tests show the function executes with students having 0–2 reviews, violating the invariant.
Testing suite:
Invariant Violation: Violates the requirement that all students must have 4 reviews before system upgrade, undermining academic evaluation.
System Disruption: Premature upgrades may graduate students with incomplete reviews, eroding system reliability.
Exploitation Risk: A malicious principal can upgrade early, bypassing reviews, potentially favoring unqualified students.
Foundry and manual code review.
Add a review count check in graduateAndUpgrade
:
All students are graduated when the graduation function is called as the cut-off criteria is not applied.
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.