Function buyPresent()
works incorrectly and allows anyone to burn anyone's tokens without permission.
A user can frame someone's address and burn their Santa tokens. See below:
High. The implementation of the function and the ease of intentional or unintentional manipulation leads to a mess of user balances.
Manual check.
msg.sender
should only be able to burn their own tokens
Consider to use PURCHASED_PRESENT_COST
for buying
Current implementation allows a malicious actor to burn someone else's tokens as the burn function doesn't actually check for approvals.
This line indicates that the intended cost of presents for naughty people should be 2e18: https://github.com/Cyfrin/2023-11-Santas-List/blob/6627a6387adab89ae2ba2e82b38296723261c08a/src/SantasList.sol#L87 PURCHASE_PRESENT_COST should be implemented to enforce the cost of presents.
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.