Snowman Merkle Airdrop

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

Critical Bug in EIP712 Type Hash Due to Typo (addres instead of address)

Summary

The constant MESSAGE_TYPEHASH is defined incorrectly as keccak256("SnowmanClaim(addres receiver, uint256 amount)") instead of keccak256("SnowmanClaim(address receiver, uint256 amount)").
This invalid type hash affects EIP712 signature generation and verification.

Description

Since EIP712 requires that the type hash precisely matches the off-chain signer struct, this typo may cause:

Incorrect digest computation on-chain.

All off-chain signatures generated using the correct schema would fail verification on-chain.

Only clients who replicated this typo off-chain would produce valid signatures.

It tightly couples the system to the typo'd struct and may cause future failures if off-chain code is fixed.

Impact

Invalid signature verification.

Incompatibility between off-chain and on-chain signing.

Likelihood

HIGH

PoC

function testTypoInMessageHashPOC() public {
bytes32 correctHash = keccak256(bytes("SnowmanClaim(address receiver, uint256 amount)"));
bytes32 buggyHash = keccak256(bytes("SnowmanClaim(addres receiver, uint256 amount)"));
console.log("correctHash", vm.toString(correctHash));
console.log("buggyHash", vm.toString(buggyHash));
assert(correctHash!=buggyHash);
}

Tools used

Manual verification

Recommended mitigation

Update the constant to:
bytes32 private constant MESSAGE_TYPEHASH = keccak256("SnowmanClaim(address receiver, uint256 amount)");

Updates

Lead Judging Commences

yeahchibyke Lead Judge 5 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Inconsistent MESSAGE_TYPEHASH with standard EIP-712 declaration

A typo in the `MESSAGE_TYPEHASH` variable of the `SnowmanAirdrop` contract will prevent signature verification claims. Used `addres` instead of `address`

Support

FAQs

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