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.
function testSignatureReplay() public {
vm.startPrank(user);
}
mapping(address => uint256) public nonces;
bytes32 messageHash = keccak256(
abi.encodePacked(user, amount)
abi.encode(user, amount, nonces[user])
);
nonces[user]++;
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.