Description:
The claim
function in the MerkleAirdrop
contract does not verify that the msg.sender
is the same as the account
parameter. This allows anyone to call the function assuming that they provide the correct account
, amount
and merkleProof
values, as the parameter values are publicly available.
Impact:
This vulnerability enables an attacker to claim tokens on behalf of any account, potentially leading to unauthorized distribution of tokens. The tokens are only sent to the account
address and not to the msg.sender
's address, however it undermines the integrity of the token distribution process.
Proof of Code:
Add the following test to MerkleAirdropTest.t.sol
and run forge test --zksync --mt testAnyoneCanCallClaim
.
Recommended Mitigation:
Implement a check within the claim
function to ensure that msg.sender
is the same as the account
parameter as shown below-
Tools Used: Manual Review and Foundry for POC
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.