Snowman Merkle Airdrop

AI First Flight #10
Beginner FriendlyFoundrySolidityNFT
EXP
View results
Submission Details
Impact: high
Likelihood: high
Invalid

Signature Replay Attack in claimWithSig() Allows Unlimited NFT Claims

Root + Impact

Description

The claimWithSig() function is intended to allow users to claim Snowman NFTs using an off-chain signature. The contract verifies the signature using ecrecover to ensure that it was signed by an authorized signer.

However, the implementation does not include any replay protection mechanisms such as nonces, signature usage tracking, or expiration timestamps.

Likelihood:

  • Reason 1 A valid signature can be reused indefinitely because there is no nonce or signature tracking implemented.

  • Reason 2 The contract does not bind the signature to a unique execution context, allowing repeated execution of the same signed message

Impact:

  • Impact 1 Attackers can mint unlimited Snowman NFTs using a single valid signature.

  • Impact 2 This breaks the integrity of the airdrop mechanism and can drain the entire NFT supply.

Proof of Concept

function testSignatureReplay() public {
vm.startPrank(user);

// First claim using valid signature
airdrop.claimWithSig(v, r, s);
// Replay the same signature again
airdrop.claimWithSig(v, r, s);
vm.stopPrank();
// If no revert occurs, the vulnerability is confirmed

}

Recommended Mitigation

  • mapping(address => uint256) public nonces;

bytes32 messageHash = keccak256(

  • abi.encodePacked(user, amount)

  • abi.encode(user, amount, nonces[user])
    );

  • nonces[user]++;


- remove this code
+ add this code
Updates

Lead Judging Commences

ai-first-flight-judge Lead Judge about 2 hours ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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

Give us feedback!