Description:
The current checks present in ThePredicter.sol::register()
don't confirm whether the registering address is already a player, allowing a user to bypass the ThePredicter__CannotParticipateTwice();
rule. When an already approved player re-uses their address in an attempt to re-register, if approved, the same address occupies more than one slot in the players
array.
Impact:
If the organizer approves an address that is already in the players
array but has re-registered, it is possible for the user to take up more than one participation slot denying entry to other valid users looking to participate.
Tooling:
This issue was noted as part of manual code review.
Proof of Concept:
Insert the following function into ThePredicter.test.sol
file and run the command forge test --match-path test/ThePredicter.test.sol --mt test_reregister -vvv
to demo the same address being entered twice into the players
array.
Remediation:
It is recommended to add another check to ThePredicter.sol::register()
to confirm a users address isn't already present in the players
array before being added in.
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.