Attacker can burn others' token to buy present for himself.
The function Santalist.buyPresent
allow msg.sender to mint Present by burning a certain amount of token. This function burns the token of the presentReceiver
without checking for approvals. An attacker can burn the token of all users to buy presents for themselves.
The balance of all SantaToken(ERC20) can be drained.
Foundry
Always check for approval before performing actions on user's token.
Rewrite the function to only burn the msg.sender's token and mint to presentReciever
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.