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

Misleading require statement in selectWinner()

Summary

Misleading require statement in selectWinner()

Vulnerability Details

The check 'require(players.length >= 4, "PuppyRaffle: Need at least 4 players")' does not take into account that the 'players' array could be filled with address(0) values only.

Impact

The function logic could proceed assuming there are active players while there are none.

Tools Used

Manual review

Recommendations

The actual culprit is the 'refund' function. It simply must be removed. However if the issue is to be fixed locally, it must be checked that there are at least 4 non-zero addresses.

Updates

Lead Judging Commences

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

refund-doesnt-reduce-players-array-size-causing-protocol-to-freeze

zero address can win the raffle

Funds are locked to no one. If someone gets the refund issue, they also got this issue. IMPACT: High Likelihood: High

Support

FAQs

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