Hawk High

First Flight #39
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Impact: medium
Likelihood: medium
Invalid

Review Timing Miscalculation

Summary:

The giveReview function attempts to enforce a minimum one-week interval between student reviews. However, due to how lastReviewTime is initialized and conditionally checked, the first review bypasses the intended timing restriction. This opens the door to review manipulation, particularly by dishonest or careless teachers.

Vulnerability Details:

require(
block.timestamp >= lastReviewTime[_student] + reviewTime,
"Reviews can only be given once per week"
);

When a student receives their first review, the value of lastReviewTime[_student] is 0 (default for uninitialized uint256).

  • This makes the condition:

    block.timestamp >= 0 + 1 week // always true

  • As a result, a teacher can give the first review at any time—even if the session just started—bypassing the intended weekly interval.

Impact:

Violation of game/session rules: Reviews may be clustered close together instead of spaced weekly.

Skewed review scores: Malicious teachers may rush all reviews quickly.

Bypassing review schedule: Undermines the school’s weekly evaluation structure and can lead to premature graduation or penalties.

Tools Used:

Mannual Review

Recommendations:

if (reviewCount[_student] > 0) {
require(block.timestamp >= lastReviewTime[_student] + reviewTime,"Reviews can only be given once per week");
}
Updates

Lead Judging Commences

yeahchibyke Lead Judge 20 days ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
yeahchibyke Lead Judge 20 days ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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