The contract does not enforce the review interval for a student's first review because lastReviewTime defaults to zero. This allows a teacher to give the first review immediately after session start, bypassing the intended waiting period. The review interval check only restricts subsequent reviews, not the initial one.
Description:
The giveReview function enforces a review interval by requiring that block.timestamp is greater than or equal to lastReviewTime[_student] + reviewTime. However, for a student who has never been reviewed, lastReviewTime[_student] defaults to zero. As a result, the first review can be given at any time after session start, regardless of the intended review interval.
Exploit Scenario:
Immediately after the session starts, a teacher may unintentionally give a review to a student before the required one-week interval has passed. Because lastReviewTime is uninitialized and defaults to zero, the contract permits the first review to be submitted right away. This could result in student scores being affected earlier than intended, simply due to a teacher acting without realizing the review interval has not yet elapsed.
PoC
Teachers can immediately give a review to any new student without waiting for the review interval (e.g., 1 week).
This bypasses the intended time-based restriction for the first review, potentially allowing for unfair or unintended manipulation of student scores right after enrollment.
Foundry
Initialize lastReviewTime for each student at session start to the current block timestamp. This enforces the review interval for the first review and closes the vulnerability.
`inSession` not updated after during upgrade
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.