The giveReview function in the LevelOne contract contains a critical vulnerability where it checks if a student's review count is less than 5 but never actually increments the counter. This bypasses a crucial access control mechanism intended to limit the number of reviews a student can receive.
In the giveReview function, there is a check:
However, after this check passes, the function fails to increment the reviewCount[_student] value. This means:
The reviewCount[_student] value will always remain at its initial value of 0
The check will always pass regardless of how many times a teacher reviews a student
A student could potentially receive unlimited reviews, as opposed to the intended limit of 5
This nullifies the protection mechanism intended to limit teacher influence on student scores.
The impact of this vulnerability is high because:
Teachers can give unlimited negative reviews to a specific student, potentially reducing their score to 0 and ```there is no session check to stop more than 4 reviews```
This breaks the intended system balance where student scores should be influenced by a maximum of 5 reviews
Malicious teachers could target specific students disproportionately
The absence of a functioning review count creates an unpredictable and inequitable review system
A teacher calls giveReview for student A with a negative review
The reviewCount[studentA] check passes since it's 0 (default value)
The student score is reduced by 10 points
The reviewCount[studentA] remains at 0
The same teacher can repeatedly call giveReview (once per week due to the time check) indefinitely
The vulnerability can be fixed by adding a line to increment the review counter:
`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.