The LevelOne contract implements a review system that is meant to limit teachers to giving at most 5 reviews per student. However, due to a critical implementation error, the review counter is never incremented after a review is given, allowing teachers to provide unlimited reviews to students.
The contract defines a private mapping to track review counts:
In the giveReview function, there is a validation check:
The vulnerability exists because after this check passes, the function never updates the reviewCount mapping for the student. Since reviewCount[_student] defaults to 0 for new mappings in Solidity and is never modified, this check will always pass.
This vulnerability has several serious implications:
Score Manipulation: Teachers can continuously give negative reviews to students, potentially reducing their score to 0
System Invariant Violation: The system is designed with an expectation that students receive a maximum of 5 reviews, but this constraint is broken and there is no sessionEnd check to stop more than 4 reviews , so the student gets infinite times.
Graduation Criteria Interference: If student graduation or advancement depends on maintaining certain scores, this vulnerability allows arbitrary interference with those scores
Fairness Disruption: The education system model assumes fair and limited evaluation, but this vulnerability enables selective targeting of specific students
Consider this scenario:
A teacher calls giveReview(studentAddress, false) for the first time
The reviewCount[studentAddress] is 0 (default value), so the check passes
The student's score is reduced by 10
After one week, the teacher can again call giveReview(studentAddress, false)
Since reviewCount[studentAddress] is still 0, the check passes again
This process can be repeated indefinitely, once per week
Add a statement to increment the review counter after each successful review:
Additionally, consider adding a function to view a student's current review count for transparency.
`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.