The system is able to upgrade through use of the 'graduateAndUpgrade' function even if not all students have 4 reviews as there is not check for it, breaking a key invariant.
The protocol states that each student is required to have 4 reviews in order for the system to be able to upgrade (through the use of the 'graduateAndUpgrade' function. Within this function there are no require or revert statements that prevent the upgrade from occurring if any students don't have 4 reviews.
This allows the system to be upgraded when it should not be allowed to. Ultimately this could prevent students from being able to graduate if a teacher hasn't given them all necessary reviews even if they would have a passing grade. A malicious prinicpal could also call this function to force wages to be paid out earlier than they should.
Manual review and Foundry
Implement a check that will cause the function to revert if not all students have the required amount of reviews (optional but recommended: create a custom error named HH__InsufficientReviews()
and a public constant uint256 variable with the name and value REQUIRED_REVIEWS = 4
):
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.