I took a deep dive into the Snowman
smart contract, an ERC721-based NFT setup for airdropping some cool snowman tokens. My main focus was checking out a big red flag: the mintSnowman
function has no access control, meaning anyone can mint NFTs like there’s no tomorrow. I wrote a Proof of Concept (PoC) to prove this issue is real and ran it through Foundry to confirm it. The mintSnowman
function is wide open—anyone with an Ethereum wallet can call it and mint as many NFTs as they want to any address. There’s no check to see if the caller is the owner or has permission, which is like leaving your front door unlocked in a busy neighborhood.
Likelihood:
Very Likely: This is a no-brainer exploit. Anyone can call mintSnowman
with a simple transaction, no hacking skills needed. If your airdrop gets hot, you can bet bots will swarm it like sharks smelling blood. I’ve seen this before in cases like the LAND Token Exploit, where missing access controls let attackers run wild.
Likelihood Rating: High
Impact:
Token Flood: An attacker could mint millions of NFTs, making your snowmen about as valuable as Monopoly money. This kills the hype for collectors.
Denial-of-Service: If someone spams the function, the s_TokenCounter
could skyrocket, messing up future mints or confusing marketplaces trying to track tokens.
Reputation Hit: Nobody trusts an airdrop where bots can snatch all the goods. Users will bail.
Money Loss: If these NFTs trade on OpenSea or Blur, an oversupply could crash their price, hurting early buyers.
Lock down mintSnowman
so only the owner can call it. Use OpenZeppelin’s onlyOwner
modifier, like this:
Test the fix by adding this to your test file:
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.