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

M-3: selectWinner function starts new raffle before the previos one is concluded

Summary

MEDIUM-3: The "selectWinner" function sets the "raffleStartTime" before the previous raffle is concluded, creating a potential for tampering with the previous raffle.

Vulnerability Details

The "raffleStartTime = block.timestamp;" statement should be the very last one executed in order to secure a fresh start of all the key variables, and further safely transfer the prizePool and the NFT to the winner. The attacker might register new players and overwrite the winner of the previous raffle.

Impact

Potential reentrancy attack, tampering with finished raffle if the "raffleDuration" variable is set very low (in units/seconds). To prevent this misuse

Tools Used

Static analysis, Solodit

Recommendations

Move the "raffleStartTime = block.timestamp;" line to the very end of the "selectWinner" function.

Updates

Lead Judging Commences

patrickalphac 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.