The buyPresent
function in the SantasList
contract contains a critical vulnerability where it burns SantaTokens
from the recipient's address instead of the sender's address. This flaw allows any user to burn tokens from another user's account without consent.
In the SantasList
contract, the buyPresent
function is designed to allow users to buy presents using SantaTokens
. However, due to a flaw in the implementation, the function burns tokens from the presentReceiver's account, not the msg.sender (the buyer). This design does not conform to the standard token burning practice, where the caller of the function should be the one whose tokens are burned.
This vulnerability poses a significant security risk, allowing any user to burn tokens from another user's account without permission. It could be exploited to deplete the SantaToken balance of unsuspecting users, leading to loss of tokens and potentially disrupting the token ecosystem.
manual
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.