Description: In function LevelOne::graduateAndUpgrade there is no check for students who do not have the minimum amount of score to be able to graduate, meaning that the protocol can be upgraded even if there are students who have not passed. These students should be expelled before upgrading the protocol so students who do not pass can't graduate. This breaks one of the invariants of the protocol that is written in the documentation of the protocol.
Impact: Students who do not meet the cutOffScore can be graduated by the system, breaking the protocol.
Proof of Concept: Student eli has a score of 60 which does not meet the cutOffScore of 70, but function graduateAndUpgrade does not revert.
Put this in the LeveOnelAndGraduateTest.t.sol:
Recommended Mitigation: Keep track of the students who have their score below the cutOffScore in the LevelOne::giveReview function after every review given and check in the graduateAndUpgrade function if the number is greater than 0.
Add a variable to keep track of number of students who have not passed:
Check if a student's score has gone below the threshold:
Revert if cutOffStudents is bigger than 0 when trying to upgrade protocol:
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.