Malicious user can steal a gift using vulnerable "buyPresent" function.
Function "buyPresent" allows users to exchange santatoken for gift NFT:
For example, a victim wants to buy NFTs for his naughty friend, so he first calls a "approve" function for his santatokens. A malicious user notices this and preempts the victim by calling the "buyPresent" function, specifying victim's address as an argument. Since the tokens are burned from the specified address:
the victim will lose the tokens. But in return, the naughty friend will not receive NFT, as the "_mintAndIncrement" function offers a gift to the one who called it:
In this case, the malicious user is msg.sender, and he will receive the NFT without losing anything.
Manual review, forge.
Recommended to change the "buyPresent" function like this:
msg.sender of the function burns his santatokens;
presentReceiver receives a gift by entering his address in the "_mintAndIncrement" 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.