The mintSnowman
function is publicly accessible and allows any address to mint an arbitrary number of NFTs to any address. This could lead to unauthorized minting of NFTs.
Likelihood:
This will occur when any external actor (EOA or smart contract) discovers the contract address and sees the public interface (via a block explorer or ABI).
Since no onlyOwner
, onlyAdmin
, or merkle-based claim control exists, nothing stops bots, malicious actors, or curious users from mass minting Snowman NFTs on deployment or after discovering the contract.
Impact:
Unauthorized users can mint NFTs, potentially leading to inflation of the NFT supply and devaluation.
This PoC clearly demonstrates how any user (not just the contract owner) can mint NFTs using the mintSnowman()
function, without constraints. By simulating the attacker with vm.prank
, it shows the issue in isolation, providing an immediate and verifiable reproduction of the vulnerability.
Add a modifier to restrict who can call the mintSnowman
function. The simplest approach is using OpenZeppelin's onlyOwner
, since the contract already inherits Ownable
.
The mint function of the Snowman contract is unprotected. Hence, anyone can call it and mint NFTs without necessarily partaking in the airdrop.
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.