The giveReview
function does not track the number of reviews submitted for each student. This allows teachers to submit an unlimited number of reviews, potentially manipulating student scores and violating the invariant that each student should only receive exactly 4 reviews (one per week) before the system can be upgraded. Without tracking the review count, students could be graduated or expelled based on incomplete or inflated review data.
In the current implementation of giveReview
, the review count (reviewCount[_student]
) is never incremented. This oversight means the function will allow an unlimited number of reviews to be given to a student, which could lead to the following issues:
Teachers could submit excessive negative reviews (e.g., 10 bad reviews) without being stopped.
The reviewCount[_student]
is always less than 5, bypassing the review limit and allowing manipulative behavior.
Students may receive inaccurate final scores, potentially leading to wrongful graduations or expulsions based on incomplete data.
Exploit Scenario:
Teacher calls giveReview
for a student 10 times in Week 1.
reviewCount[_student]
never increments, so all 10 reviews are accepted.
The student's score drops to 0 due to 10 bad reviews, leading to unfair expulsion.
Code Snippet: Vulnerable Path:
Data Integrity: The system cannot guarantee that students will receive exactly 4 reviews, which undermines the integrity of the review process.
Malicious Exploitation: Teachers could spam reviews to manipulate student scores, resulting in unfair graduations or expulsions.
Protocol Invariant Violation: The protocol's invariant that students must receive exactly 4 reviews before being graduated or expelled is not enforced, breaking the system's logic and expectations.
Misleading Data: Without proper review tracking, the graduation process could either fail to complete or be executed unfairly.
Manual review
The fix for this issue involves tracking the review count for each student, limiting the number of reviews to 4, and ensuring reviews are aligned with the session weeks. Additionally, a check should be added in the graduateAndUpgrade
function to enforce that all students have received exactly 4 reviews before the system can be upgraded.
`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.