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

Potential DoS on Unbounded player loop

Summary

When enterRaffle function invoked, all player will be traversed in the loop, which may run out the gas

Vulnerability Details

// Check for duplicates
for (uint256 i = 0; i < players.length - 1; i++) { //@audit gas dos with unbounded loop
for (uint256 j = i + 1; j < players.length; j++) {
require(players[i] != players[j], "PuppyRaffle: Duplicate player");
}
}

Impact

DoS on the enterRaffle function

Tools Used

Manual

Recommendations

Set upperbound for the user may join, and limit number of new player for each batch.

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!