The intended behavior of the mintSnowman
function is to act as a restricted, privileged action, exclusively callable by an authorized address (such as the SnowmanAirdrop
contract). This controlled access is fundamental to guaranteeing that Snowman
NFTs are only created for users who legitimately complete the airdrop claim process, thus preserving the scarcity and value of the collection.
The mintSnowman
function is implemented as external
but critically lacks any access control mechanism. Without an onlyOwner
modifier or a similar role-based check, any external account on the blockchain can call this function directly to mint an arbitrary number of NFTs for any recipient, at no cost, completely bypassing the intended airdrop mechanism.
The risk is assessed as Critical. This is the highest possible rating, justified by a High likelihood of exploitation and a Critical impact that completely breaks the entire economic model of the NFT collection.
Reason 1: This vulnerability is exploited the moment any user or automated bot discovers the public mintSnowman
function. The attack consists of a single, simple transaction call that requires no special conditions, permissions, or capital.
Reason 2: The lack of access control on a minting function is a widely known and fundamental security anti-pattern in smart contract development. It is trivial to discover through automated scanning tools, manual code review, or even by simply inspecting the contract's functions on a block explorer like Etherscan.
Impact 1: The exploit results in the complete and instantaneous destruction of the NFT's value and scarcity. An attacker can create an infinite supply of Snowman
NFTs, rendering the entire collection worthless and making the SnowmanAirdrop
contract and its associated tokenomics entirely obsolete.
Impact 2: This flaw causes a catastrophic loss of user trust and project integrity. Users who participated in the Snow
token ecosystem with the expectation of a fair and exclusive airdrop will find their efforts and investment nullified, leading to irreversible reputational damage for the project.
This Proof of Concept demonstrates that any unauthorized user can freely mint Snowman
NFTs, bypassing all intended mechanisms.
Objective: To prove that an arbitrary external account can call mintSnowman
and create new NFTs for themselves without permission.
Setup: The Snowman
contract is deployed. We define an actor, randomAttacker
, who has no special roles or permissions.
Execution: The randomAttacker
directly calls the mintSnowman
function, requesting to mint 1,000 NFTs to their own address.
Success Criteria: The test succeeds by asserting that the randomAttacker
's Snowman
NFT balance is now 1,000, confirming the unauthorized minting was successful.
You can save this code as test/SnowmanMint.t.sol
in a Foundry project.
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.