The mintSnowman
function lacks critical validation checks on user inputs, particularly the amount
and receiver
parameters. This opens the contract to several potential exploits:
Gas exhaustion denial-of-service (DoS): A user can attempt to mint an extremely large number of tokens (e.g., 1 million), leading to out-of-gas errors.
Zero address minting: Tokens could be minted to the zero address, potentially locking them forever.
Unreasonable minting operations: Users can call mintSnowman
with amount = 0
, wasting gas and cluttering execution flow with no meaningful output.
Likelihood:
High — Exploiting this vulnerability requires no special permissions or cryptographic attacks. It can be triggered by any user calling mintSnowman
with an extremely large or malformed input.
Impact:
Denial of Service (High): Unbounded minting can cause transactions to fail due to out-of-gas errors. This could stall contract functionality and deter legitimate users.
Token Supply Manipulation (High): Without an upper limit, malicious users could create vast numbers of tokens, affecting game balance, economics, or platform trust.
Operational Inconsistencies (Medium): Minting to the zero address or minting zero tokens leads to state pollution or unintended behavior.
This test illustrates:
The absence of a cap on the amount
input.
The vulnerability to gas exhaustion by processing a large loop during minting.
The potential for network congestion or failed transactions.
No validation of the receiver address or minimum amount.
The proposed changes introduce three critical validation checks:
Address validation: Prevents tokens from being minted to the zero address (address(0)
), avoiding loss of assets.
Zero-amount prevention: Stops execution early if the user tries to mint zero tokens, saving gas and maintaining cleaner logic.
Mint cap enforcement: Limits the number of tokens a user can mint in a single transaction (e.g., to 10), mitigating gas exhaustion attacks and maintaining game economy integrity.
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.