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

buyPresent should have a conditional Statement or Modifier

Summary

As per the Naspec guide for the BuyPresent function in the santaList contract, it is intended to be callable by anyone possessing sufficient santaTokens.

Vulnerability Details

The flaw can be located at line 173 in the santaList.sol contract. Any individual, even those without any santaTokens, can invoke the buyPresent function. the caller of this function gains the ability to mint an NFT for free.

Impact

The buyPresent function allows anyone to burn another person's tokens without possessing any tokens themselves, attempting to burn the tokens associated with the presentReceiver address. The presentReceiver looses their santaToken without receiving any gift.

Tools Used

The identified issues were discovered through manual review and Invariant Testing.

Recommendations

  1. Implement a modifier to verify that the caller (msg.sender) has a minimum balance of santaTokens before allowing the execution of the buyPresent function.

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.