The logic of buyPresent
function in SantasList
contract is misleading. According to the docs anyone can call the function but only people marked as NICE or EXTR_NICE can benefit from them. But it turns out that anyone can call the function by providing the address which has enough SantaTokens
to mint NFT for them.
In the buyPresent function the NFT will be minted for msg.sender whereas the SantaTokens
are burned from the presentReceiver
address. So anyone call the buyPresent function with the right address as argument and mint an NFT for them.
Here is the valid POC for this vulnerability.
Assume user
has some tokens. Then a malicious user1
calls the buyPresentfunction by providing the
user` address as an argument and successfully mints an NFT on his address.
Anyone can mint nft by stealing ERC20 tokens from other accounts due to false logic in buyPresent contract.
Manual Review
Remove the presentReceiver
argument from the buypresent
function and make sure the santaTokens are burned from the address which calls the function.
In this way users can mint an nft only if they have enough santaToken
in the account. If anyone wants to buy nft for their friends they can transfer the santaToken
from their address to their friends.
Current implementation allows a malicious actor to burn someone else's tokens as the burn function doesn't actually check for approvals.
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.