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

No validation for empty array in enterRaffle

Summary

Users can call enterRaffle with an empty array as argument.

Vulnerability Details

One can call enterRaffle with an empty array. The require condition looking at the msg.value is met in this case since no entrance fee needs to be paid. An event is emitted.

Impact

This does not impact the protocol directly. The only consequence it that the calling user will use on transaction fees on a transaction that did not change any state.

Tools Used

Manual review

Recommendations

Add a require the verifies that the argument has a length of at least 1.

Example
require(newPlayers.length > 0, "PuppyRaffle: Need a minimum of 1 address to enter raffle");
Updates

Lead Judging Commences

Hamiltonite Lead Judge about 2 years ago
Submission Judgement Published
Invalidated
Reason: User input validation

Support

FAQs

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

Give us feedback!