The random slices per user is supposed to be fair, but this issue allows malicious parties to capitalize on the lack of checks that would prevent them from getting as many slices as they want. One user can potentially drain the entire pool of pizzas leaving nothing for the rest of the participants
Normally, the contract is supposed to have a check so that users can claim only once
Since there is no check for who claimed, anyone can claim over and over without any limitations
Likelihood:
Reason 1: There is nothing to prevent a user who already claimed slices from claiming again
Reason 2: This can happen over and over for as long as there are slices left in the pool
Impact:
Impact 1: One malicious user can completely drain the pool by calling the claim function repeatedly
Impact 2: The competition wouldn't be fair anymore
Since there is no check to see who already claimed, the claim function can be executed multiple times successfully by the same user
Let's run a local node
Initialize an account
Deploy the contract
Run the claim function more than once
The lack of check on who claimed and who didn't leads to multiple claims by the same user which violates the rules of the competition and makes it unfair for the rest of the participants
We add a check to make sure the user hasn't already claimed, if the user already did then the transaction fails. Also, everytime a succesful claim happens we store the user's address to keep track of who claimed and prevent multiple claims by the same user
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.