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

Zero address can be considered active player

[L-4] Zero address can be considered active player

Description:

GetActivePlayerIndex method returns 0 idx for non existing entries in players array

Impact:

Low

Tools used:
manual, foundry

Proof of concept:

function testThatGetActivePlayerResultsInWrongResponse() public playersEntered {
// in modifier players entered we add 4 players - 1,2,3,4
// we check for address that is not being used for sure for example 0
address nonExistingAddressInRaffle = address(0);
uint256 idx = puppyRaffle.getActivePlayerIndex(nonExistingAddressInRaffle);
// it returns 0 which is the index of the first player
// so in the contract puppyRaffle.getActivePlayerIndex(address(0)) is the same as puppyRaffle.getActivePlayerIndex(address(1))
assertNotEq(puppyRaffle.players(idx), nonExistingAddressInRaffle);
}
Updates

Lead Judging Commences

Hamiltonite Lead Judge over 1 year 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.