In the giveReview()
function, the contract fails to properly track the number of reviews given to each student. The reviewCount
mapping is not incremented, which means that teachers can give an unlimited number of reviews to a student, bypassing the limit set in the require
statement. This leads to a potential abuse of the review system and could cause the system to behave unpredictably.
The giveReview()
function includes a check that prevents teachers from reviewing a student more than 5 times:
However, the contract does not increment the reviewCount
mapping after a review is given. This means that a teacher can give an unlimited number of reviews to a student, circumventing the review limit and potentially spamming the student with excessive reviews. The issue stems from the following part of the function, which does not update the review count:
Infinite Reviews: Since the reviewCount
is not incremented, a teacher can give an unlimited number of reviews to a student. This could result in the student being unfairly graded or evaluated.
System Abuse: Malicious actors could exploit this flaw to flood a student’s record with reviews, potentially overwhelming the system or skewing the student’s score.
Unfair Grading: Students could be unfairly penalized or receive disproportionate reviews, leading to unfair assessments in the contract.
Solidity 0.8.26 (Compiler)
Slither for static code analysis
Increment reviewCount
Properly: After each review, the reviewCount
for the student should be incremented to ensure that the limit of 5 reviews per student is enforced. Add the following line in the giveReview()
function:
Optional: Consider adding a separate mechanism to track review timestamps or specific review details if more fine-grained control over reviews is needed.
`reviewCount` for students is not updated after each review session
`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.