Hawk High

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

Timestamp dependency

Summary

The giveReview function uses block.timestamp for time based comparisons, which can be manipulated by miners.

Vulnerability Details

The function uses block.timestamp to enforce a time restriction between reviews:

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

Impact

Miners can manipulate block.timestamp to a certain degree, which allows them to slightly subvert time based restrictions. However, since the restriction is a week long, this manipulation would have minimal impact

Recommendations

I would consider using block numbers instead of timestamps. Also I would add a small buffer to account for potential timestamp manipulation

Updates

Lead Judging Commences

yeahchibyke Lead Judge 3 months ago
Submission Judgement Published
Invalidated
Reason: Design choice
yeahchibyke Lead Judge 3 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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