A critical vulnerability has been discovered in the collectPresent() function
of the SantasList.sol
smart contract that could allow an attacker to reclaim their presents multiple times. This vulnerability is caused by the function not tracking whether the user has previously collected a present. This vulnerability could be exploited to mint an unlimited number of Santa tokens.
An attacker could exploit this vulnerability by sending or burning their NFT and then calling the collectPresent() function
again. This would allow the attacker to mint a new NFT, even though they had already collected a present.
This vulnerability could allow an attacker to:
**Mint an unlimited number of Santa tokens
**Disrupt the operation of the protocol
**Take control of affected systems
Manual Review
Modify the collectPresent() function
to store a flag indicating whether the user has already collected a present
Example of how it can be integrated :
First, we need to create the variable :
Then we ned to modify collectPressent()
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.