Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: medium
Invalid

Validator Manipulation of Raffle Winner Selection Time

Summary

The selectWinner function in the provided code uses the block.timestamp to determine whether the raffle is over. However, this approach is vulnerable to manipulation by validators, as they can control the timestamp included in the block. This vulnerability opens up the possibility of validators manipulating the winner selection time.

Vulnerability Details

The vulnerability lies in the line require(block.timestamp >= raffleStartTime + raffleDuration, "PuppyRaffle: Raffle not over");. By relying solely on block.timestamp, the function assumes that the timestamp included in the block is accurate and cannot be manipulated. However, validators have the ability to set the timestamp within certain limits, allowing them to potentially influence the outcome of the raffle.

Impact

The impact of this vulnerability is that validators can manipulate the winner selection time, leading to various consequences, including:

  • Unfair advantage for certain participants if validators intentionally delay the winner selection.

  • End the Raffle before expected time.

  • Undermining the transparency and integrity of the raffle process.

Tools Used

Manual review.

Recommendations

To mitigate the vulnerability and ensure the fairness of the raffle, the following recommendations are suggested:

  1. Implement a more secure and tamper-proof method of determining the end time of the raffle. Consider using an external time oracle (like Chainlink).

Updates

Lead Judging Commences

Hamiltonite Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

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