There are vulnerabilities in collectPresent
that allow users to mint as many tokens and NFTs as they desire.
The issue lies in the following code snippet within the collectPresent
function:
This approach to determine whether a user has already collected their reward is flawed. It allows users to transfer the NFT before calling the function again, enabling them to invoke collectPresent
multiple times.
Users can exploit this vulnerability to mint an unlimited number of NFTs (And Tokens if he is EXTRA_NICE).
Foundry
Store the user claiming the reward in a mapping to ensure that they can only collect the reward once.
Relying on balanceOf > 0 in collectPresent() allows the msg.sender to send their present to another address and then collect again.
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.