Normal behavior: _isValidSignature() should validate that a signature was produced by the expected receiver address and revert clearly on malformed input.
The issue: ECDSA.tryRecover() returns three values: (address signer, RecoverError error, bytes32 errorArg). The function discards the error code entirely. When tryRecover() fails due to a malformed signature it returns address(0) with a non-zero error code. The function only compares the address, making it impossible to distinguish a wrong signer from a completely invalid signature format.
Likelihood:
Any caller can submit a malformed signature tryRecover returns address(0) with no error propagation to the caller.
The signature verification path is the primary security gate for airdrop claims.
Impact:
Signature validation errors are silently swallowed, no distinction between wrong signer and invalid signature format.
Combined with the MESSAGE_TYPEHASH typo, signature verification is broken at two independent levels simultaneously.
The following test demonstrates that _isValidSignature() silently discards ECDSA error information. A completely malformed signature returns address(0) from tryRecover() with a non-zero error code, but the function only checks the address. The caller receives false with no way to determine the failure cause.
Option A (recommended) uses ECDSA.recover() which reverts automatically on any invalid signature. This eliminates ambiguity between wrong signer and malformed input. Option B preserves tryRecover() but explicitly checks the error code before trusting the recovered address. Option A is recommended since claimSnowman() already reverts on invalid signatures via SA__InvalidSignature. Note the function signature changes from pure to view with Option A.
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.