mintSnowmanThe mintSnowman function is designed to mint NFTs to recipients. The function should follow the Checks-Effects-Interactions pattern to prevent reentrancy attacks.
However, the function updates the state variable s_TokenCounter after external calls to _safeMint. The _safeMint function calls onERC721Received on the recipient if it's a contract, allowing for reentrancy attacks.
Likelihood:
The receiver can be a contract that implements IERC721Receiver
When _safeMint is called, it triggers onERC721Received on the receiver
A malicious contract can reenter mintSnowman during the callback
This is especially dangerous since there's no access control (see S-1)
Impact:
A malicious contract can reenter mintSnowman before s_TokenCounter is updated
The attacker can receive NFTs with unexpected token IDs
Can potentially mint more NFTs than intended
State corruption of the token counter
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.