Snowman Merkle Airdrop

First Flight #42
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Severity: high
Valid

No access control on `Snowman::mintSnowman` so anyone can mint snowman for free

Description

  • the mintSnowman function should only be callable by SnowmanAirdrop

  • Instead anyone can call this and receive free snowmen defeating the whole purpose of staking snow tokens

// Root cause in the codebase with @> marks to highlight the relevant section

Risk

Likelihood:

  • anyone can easily call mintSnowman

Impact:

  • Impact 1

  • Impact 2

Proof of Concept

add to TestSnowman.t.sol

function testMintSnowman() public {
nft.mintSnowman(alice, 1);
assert(nft.ownerOf(0) == alice);
assert(nft.balanceOf(alice) == 1);
}

Recommended Mitigation

after deploying Snowman transfer ownership to SnowmanAirdrop. add an onlyOwner modifier to Snowman::mintSnowman

Updates

Lead Judging Commences

yeahchibyke Lead Judge 11 days ago
Submission Judgement Published
Validated
Assigned finding tags:

Unrestricted NFT mint function

The mint function of the Snowman contract is unprotected. Hence, anyone can call it and mint NFTs without necessarily partaking in the airdrop.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.