The LevelOne::giveReview function allows teachers to review students once per week, up to a maximum of 5 reviews per student. However, the function never increments the reviewCount variable, meaning the condition reviewCount[_student] < 5 is always true. As a result, teachers can indefinitely lower a student’s score, bypassing intended review limits.
The function intends to limit reviews to five per student, but fails to enforce it due to missing state update:
Bypass Review Cap
Teachers can continuously give negative reviews every week since reviewCount[_student] is never updated.
Unbounded Score Reduction
A malicious teacher could reduce a student’s score to zero or below over time, preventing graduation or other benefits.
Misleading Access Control
The presence of a cap (< 5) gives the illusion of protection, but is effectively non-functional.
Academic Manipulation: Teachers can unfairly target students, causing failure or disqualification.
Broken Business Logic: Graduation criteria based on studentScore can be easily sabotaged.
Manual Code Review
Increment reviewCount[_student] after a successful review to properly enforce the 5-review limit:
`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.