The graduateAndUpgrade
function in LevelOne.sol
lacks validation to ensure students have received all required reviews before graduation. This allows students to graduate without meeting the review requirements specified in the invariants.
The contract's invariants state that "Students must have gotten all reviews before system upgrade. System upgrade should not occur if any student has not gotten 4 reviews (one for each week)". However, the graduateAndUpgrade
function does not validate the reviewCount
mapping before proceeding with the upgrade.
Key code in LevelOne.sol
:
Impact
Students can graduate without receiving all required reviews
Violates the core invariant of the system
Could lead to unfair graduation of students who haven't completed their review requirements
May result in students advancing to LevelTwo without proper evaluation
Manual code review
Foundry for testing
Add validation in the graduateAndUpgrade
function to ensure all students have received their required reviews, like iterate over listOfStudents.length and require(reviewCount[listOfStudents[i]] == 4, "Student missing reviews")
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.