Hawk High

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

Missing Review Count Increment in giveReview Function

Summary

The giveReview function in LevelOne.sol checks if reviewCount[_student] < 5 but never increments the reviewCount after giving a review. This means the review limit of 5 reviews per student is never enforced, allowing unlimited reviews to be given.

Vulnerability Details

In the giveReview function:

require(reviewCount[_student] < 5, "Student review count exceeded!!!");
// ... review logic ...
// Missing: reviewCount[_student]++

The function checks if the student has received less than 5 reviews, but never increments the counter after giving a review. This means:

  1. The check reviewCount[_student] < 5 will always pass

  2. Teachers can give unlimited reviews to any student

  3. The intended review limit of 5 reviews per student is not enforced

Impact

  • Allows unlimited reviews to be given to any student

  • Bypasses the intended review limit of 5 reviews per student

  • Could lead to score manipulation through unlimited reviews

  • Affects the integrity of the student evaluation system

  • Could allow teachers to artificially inflate or deflate student scores

Tools Used

  • Manual code review

Recommendations

Add the review count increment after giving a review:

require(reviewCount[_student] < 5, "Student review count exceeded!!!");
// ... review logic ...
reviewCount[_student]++; // Increment the review count

This will properly enforce the review limit by:

  1. Checking if the student has received less than 5 reviews

  2. Incrementing the counter after each review

  3. Preventing more than 5 reviews per student

Updates

Lead Judging Commences

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

reviewCount not updated

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

yeahchibyke Lead Judge 4 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.