Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: high
Valid

buyPresent is abusable by trolls

Summary

buyPresent can be used to troll people, burn their tokens and steal a present.

Vulnerability Details

An attacker can call buyPresent with a target address and force it to burn tokens and a present gets assigned to the attacker.

Impact

People see their tokens effectively get stolen.

There will be no token market as they will all be burnable by trolls.

Many presents will be stolen by bad actors.

Tools Used

N/A

Recommendations

Remove the presentReciever parameter and just use msg.sender

AND

If the intent is to allow people to buy a present for others, implement the presentReceiver parameter in mintAndIncrement function instead.

Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

buyPresent should use msg.sender

Current implementation allows a malicious actor to burn someone else's tokens as the burn function doesn't actually check for approvals.

buyPresent should send to presentReceiver

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.