burn in buyPresent function can burn any user's SantaTokens.
The parameter of burn in buyPresent function is wrong. The parameter presentReceiver allow anyone to burn anyone's SantaTokens.
Due to the wrong parameter, attacker, anyone can burn any user's SantaTokens.
Hence, destroying all the tokens and compromising the major logic of the contract.
Manual Review
To mitigate the vulnerability, parameter of burn should be msg.sender.
Here's how you can modify the function:
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.