The buyPresent()
function allows any user to input the recipient's address, but the buyPresent()
function burns the ERC20 tokens of the recipient to mint NFT tokens for msg.sender
instead of burning msg.sender
's ERC20 tokens to mint NFT tokens for the recipient."
A user with both checks as EXTRA_NICE can receive 1 NFT token and 1e18 ERC20 tokens by collectPresent()
function. An attacker can exploit the buyPresent()
function by providing the address of a user with ERC20 tokens, burning the ERC20 tokens of that user, and minting NFT tokens for the attacker.
Users do not need to approve the SantaList contract to spend their own tokens because the burn permission allows the SantaList contract to burn users' tokens.
All users who own ERC20 tokens may be vulnerable to the attacker, who may burn the users' ERC20 tokens and mint NFTs for himself.
The _mintAndIncrement()
function should add a parameter for the recipient's address.
The buyPresent()
function should burn the ERC20 tokens of the caller and mint NFT tokens for the recipient.
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.