When a recipients index start from zero the coresponding recipient with index of zero can call SablierV2MerkleLL.sol::claim
and SablierV2MerkleLT.sol::claim
functions multiple times.
The SablierV2MerkleLL.sol::claim
and SablierV2MerkleLT.sol::claim
functions called SablierV2MerkleLockup::_checkClaim
internal function to check if the recipient index already claimed or not using below code.
But when the recipient index is zero it will always return false and allow the recipient to claim again.
The vulnerability will allow recipient with an index of zero have multiples NFTs (streams) which will allow him to have token amount multiple times.
In the /v2-periphery/test/utils/Defaults.sol
change the INDEX1
, INDEX2
, INDEX3
and INDEX4
constant variables value to 0, 1, 2, 3 from 1, 2, 3, 4 to make the recipients index start from zero. Then in /v2-periphery/test/integration/merkle-lockup/ll/claim/claim.t.sol
test file add the below test code.
Manual review
Prevent SablierV2MerkleLL
and SablierV2MerkleLT
creators from assigning an index of zero to recipient. Also add the below check in SablierV2MerkleLockup::_checkClaim
internal function to enhance security.
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.