An attacker can mint unlimited NFTs and SantaTokens transfering the NFT to other account.
In SantaList.sol
, the collectPresent()
is designed for users to claim an NFT if they have a NICE status or an NFT, and additionally, SantaTokens if they possess an EXTRA_NICE status. The issue lies in the present claiming mechanism, where the check to ensure users claim only once is based on balanceOf(msg.sender) > 0
.
A vulnerability arises as an attacker can transfer the minted NFT to another account, resetting the balanceOf()
to 0. Consequently, the attacker can fraudulently claim the present multiple times, thereby exploiting the protocol. This not only violates the protocol's stipulation that an address should only mint one NFT but also allows the attacker to mint an unlimited number of SantaTokens.
The attacker can mint an unlimited quantity of SantaTokens and NFTs, leading to a scenario of hyperinflation for both the token and the NFT.
Manual review.
Implement a mapping to track whether a user has already claimed their present. Integrate it into the collectPresent()
.
mapping(address => bool) presentClaimed
This ensures that each user can claim the present only once by checking the mapping before processing the function logic.
Relying on balanceOf > 0 in collectPresent() allows the msg.sender to send their present to another address and then collect again.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.