reviewCount mapping is used in an access control check but never updated, allowing infinite reviews per student.
The LevelOne.sol
contract has the following check in the giveReview()
function:
However, reviewCount[_student] is never incremented anywhere in the codebase. This means that for any _student, reviewCount[_student] will always remain 0, effectively bypassing the review limit check. That is reviewCount[_student] will always be less than 5.
As a result:
Teachers can call giveReview() unlimited times.
They can arbitrarily reduce a student’s studentScore, since bad reviews deduct 10 points.
The invariant “students must only be reviewed once per week, up to 4 times per session” is violated.
Score manipulation: A malicious or buggy teacher can give multiple bad reviews, tanking a student’s score below the cutOffScore, preventing them from graduating.
Bypass core logic: The system assumes a fixed number of reviews per student per session. This bug breaks that invariant.
Potential griefing attack: Repeated bad reviews could be used to block a student from progressing indefinitely.
Manual code review
forge test suite
Here is the foundry test:
This test demonstrates a critical flaw: since reviewCount is never incremented,
teachers can repeatedly call giveReview every week, indefinitely penalizing the student.
Increment reviewCount[_student] inside the giveReview() function:
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.