Hawk High

First Flight #39
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: low
Valid

Missing reviewCount Increment

Summary

Missing increment of reviewCount in giveReview allows infinite reviews, breaking the 4-review limit and upgrade invariant.

Vulnerability Details

The giveReview function in LevelOne.sol checks reviewCount[_student] < 5 to limit reviews but fails to increment reviewCount after a review is given. This allows Teachers to submit unlimited reviews to a student, violating the invariant of "1 review per week" and enabling bypass of the "4 reviews required before upgrade" check in graduateAndUpgrade.

Impact

Allows invalid upgrades and inconsistent student scoring, compromising the system's integrity.

Tools Used

Manual code review and Foundry testing.

Recommendations

Add reviewCount[_student]++; in the giveReview function after the review logic to correctly track the number of reviews.

Updates

Lead Judging Commences

yeahchibyke Lead Judge 6 months ago
Submission Judgement Published
Validated
Assigned finding tags:

reviewCount not updated

`reviewCount` for students is not updated after each review session

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.