Claiming reward in SablierV2MerkleLL
and SablierV2MerkleLT
can be front-runned because leaf hash is generated from function arguments which are not protected and publically available.
claim()
function in SablierV2MerkleLL
and SablierV2MerkleLT
creates stream for user that provided valid proof with correct data (index, recipient, amount). Validating of provided data is done by hashing (index, recipient, amount) if proof is valid for generated leaf.
If provided data is correct contract creates stream and makes sure that no one can create stream with the same data as it's already has been claimed:
As recipient, index and amount parameters are obtained from function arguments, any user can call this function with these parameters. Because of that malicious user can make next steps to steal other user's funds:
Malicius user set up front-running bot to watch pending transactions to SablierV2MerkleLL.claim()
or SablierV2MerkleLT.claim()
If such transaction occurs, bot checks it will be successful
If it would make transaction with much higher gas amount to execute transaction faster than original user
Malicious user that uses front-running bot can claim other users' reward.
Make that only user can claim their reward by using msg.sender
instead of function argument recipient
:
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.