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

Attacker can steal users tokens and buy present for himself

Summary

Attacker can steal user tokens and use them to buy nfts for himself by passing user address as a parameter to the buypresent function. Since the function charges the passed address for the token, the user token will be deducted for the trade instead for the msg.sender

Vulnerability Details

Logic error

Impact

loss of tokens

Tools Used

foundry

Recommendations

buyPresent should burn msg.sender tokens instead of presentReciever

Updates

Lead Judging Commences

inallhonesty Lead Judge almost 2 years 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.

Support

FAQs

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