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

SantasList::collectPresent can mint NFT transfer it to another address and mint again

Summary

If a user have the status NICE twice and the block timestamp is after christmas, the user can mint infinite number of NFT because the check is done with

if (balanceOf(msg.sender) > 0) {

so the user can transfer the minted NFT and mint it again.

Vulnerability Details

self explanatory from summary

Impact

huge because we break the invariant rule that one address should be able to collect only 1 NFT

Tools Used

reading the code

Recommendations

create a record when a user claim an NFT such as

mapping( address => boolean) private hasMinted;

and then check this record instead of the address balance in the collectPresent function

Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year 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.