According to the documentation students should only receive one review per week. The documentation also states that a school session lasts 4 weeks. We can safely assume that means that students should not receive more than 4 reviews in one school session.
This is confirmed by the following entry in the documentation:
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)
There is also a validation for the number of received reviews but it is implemented incorrectly and allows students to receive 5 reviews in one school session.
The vulnerability is located in the reviewStudent
function of the LevelOne
contract.
The first require statement checks if the student has received less than 5 reviews. This is incorrect and should be changed to check if the student has received less than 4 reviews since we are trying to add a new review.
POC: the following test should fail but it does not:
The contract allows teachers to give students 5 reviews in one school session. This is a violation of the documentation and can lead to unexpected results.
Since reviews can decrease the score of a student, this can lead to students not graduating even tough they would not be in danger of failing if they would have received only 4 reviews.
A teacher could exploit this vulnerability to give a student 5 reviews to decrease their score more than allowed.
Manually reviewed the code and the documentation.
The require statement should be changed to check if the student has received less than 4 reviews instead of 5.
`reviewCount` for students is not updated after each review session
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.