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

SantasList__UnauthorizedBurn

Summary

A critical vulnerability has been discovered in the buyPresent() function of the SantasList.sol smart contract that could allow an attacker to burn any user's Santa tokens without their consent. This vulnerability is caused by the function not verifying that the token owner has approved the burn transaction. This vulnerability could be exploited to steal Santa tokens from other users.

Vulnerability Details

An attacker could exploit this vulnerability by calling the buyPresent() function with the address of the victim as the presentReceiver parameter. This would cause the victim's Santa tokens to be burned, even if they had not approved the transaction.

Impact

This vulnerability could allow an attacker to:

**Steal Santa tokens from other users

**Disrupt the operation of the protocol

Tools Used

Manual Review

Recommendations

Modify the buyPresent() function to verify that the token owner has approved the burn transaction.
For example, the function can be modified to :

function buyPresent(address presentReceiver) external {
// Verify that the token owner has approved the burn transaction
require(i_santaToken.allowance(presentReceiver, address(this)) >= 1, "Burn not approved");
// Burn the token
i_santaToken.burn(presentReceiver);
// Mint a new NFT for the present receiver
_mintAndIncrement();
}
Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Other
darkart Submitter
over 1 year ago
inallhonesty Lead Judge
over 1 year ago
inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

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