The PuppyRaffle contract has a high-severity vulnerability in the refund function. This vulnerability could allow malicious players to manipulate the players array, potentially affecting the winner selection process and leading to a loss of funds.
In the refund function, the players[] array is populated with zero addresses every time an user refunds. The selectWinner() function selects winner from the index of players. This could lead to transferring to the 0 address thus loss of funds.
Severity: High (Loss of funds)
Likelihood: High (The likelihood increases as the number of users refunding increases)
VS Code
Populate the players array in different way such that all the addresses are valid players' addresses:
Check for zero address before transferring (from selectWinner()).
Funds are locked to no one. If someone gets the refund issue, they also got this issue. IMPACT: High Likelihood: High
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.