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

collectPresent doesn't update user status, hence user can keep collecting present

Summary

user can keep withdrawing present as many times as he want from the collectPresent function. The collectPresent checks if there is nft in the user address to control the number of time user can collect present but this can be bypassed by sending the nft out the wallet. The user can collect present multiple as long as he sends the nft in his wallet to another address.

Vulnerability Details

logic error

Impact

user can collect present multiple times

Tools Used

foundry

Recommendations

A state should be introduced to track if the user has collected present or not.

Updates

Lead Judging Commences

inallhonesty Lead Judge almost 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

Weak Already Collected Check

Relying on balanceOf > 0 in collectPresent() allows the msg.sender to send their present to another address and then collect again.

Support

FAQs

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