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

Array players could be too long if entranceFee is small

Summary

If entranceFee is small, attacker can call enterRaffle() with a long array of players to "inflate" the players array. That will put getActivePlayerIndex() and _isActivePlayer() into DoS state.

Vulnerability Details

Attacker can call enterRaffle() with a long array of players if entranceFee is small enough. By doing so, players array will become too long so that looping through it will cost more gas than block gas limit. That will DoS calls to getActivePlayerIndex() and _isActivePlayer().

Impact

Possible DoS in getActivePlayerIndex() and _isActivePlayer().

Tools Used

Manual review

Recommendations

Limit players length to a certain number so that looping through it won't exceed block gas limit.

Updates

Lead Judging Commences

Hamiltonite Lead Judge about 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

denial-of-service-in-enter-raffle

Support

FAQs

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

Give us feedback!