The mintSnowman
function is declared "external" with no access control whatsoever. Any address can call it to mint as many snowman NFTs as possible to any recipient.
Likelihood:
High.
Since the function is declared external, anyone can call it without any prerequisites or on-chain cost beyond gas.
Impact:
High
Unrestricted minting allows complete takeover of the NFT supply. Even legitmate NFTs might become inaccessible if the attacker keeps minting NFTs to recipients (DoS).
Append the following code to TestSnowman.t.sol
and then run forge test --match-contract TestSnowman
, if all test passed it means that the user bob has minted 31800 tokens.
Restrict access to `mintSnowman` by adding a modifier that checks if the caller is authorized or not. So only the authorized addresses can call it, otherwise it will revert. The only_Owner modifier has require statement that check if msg.sender is equal to the deployed SnowmanAirdrop contract's address:
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.
The contest is complete and the rewards are being distributed.