https://github.com/Cyfrin/2024-10-sablier/blob/main/src/SablierFlow.sol#L564-#L621
https://github.com/Cyfrin/2024-10-sablier/blob/main/src/SablierFlow.sol#L792-#L794
In the _create()
function, streamId is consecutive increase by one:
Along with allowing set sender
address to arbitrary address, it opened attack vector when reorg happen:
User A create stream with id = 50, set user B as sender
Sometimes later, user B deposit token to that streamId
Reorg happen, attacker do these actions in one transaction:
1, create streamId with same id = 50
due to reorg with same sender but receiver is different
2, approve permission of that streamId for attacker's controlled address, then transfer it to original recipient
Later, user B deposit to that streamId, attacker can withdraw part of them due to being approved before:
Victim's token can be stolen when reorg happen
Manual review
streamId
should be randomly generated by using caller's address and other parameters.
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.