The sender has the option to cancel their own stream for any reason. Once the cancellation is initiated, the streamed money is delivered to the recipient and the sender withdraws the remaining funds. However, before the SablierV2Lockup::cancel transaction is completed, the recipient can deny the completion of this transaction.
In any case where the sender feels uncomfortable with the transaction and wants to rescue the remaining funds, the sender calls the SablierV2Lockup::cancel function. After the initial check is done, SablierV2Lockup::_cancel is called. At that point, the streamed money is delivered to the recipient and the remaining funds are intended to be sent back to the sender. However, before the call is finished, this hook is invoked:
This allows the recipient to control this call and use all the gas, preventing the transaction from completing.
Moreover, the recipient can use an EOA as the recipient when the stream is created and show no intention of malicious behavior. However, after the creation of the stream, when the NFT is minted, it can be transferred to a new recipient with a malicious implementation in the hooks.
Note: This can also affect the SablierV2Lockup::renounce function, but since this call benefits the recipient, it is not included as a severity issue.
If you implement this minimal test in Remix IDE, you may encounter the error transact to Sablier.withdraw errored: estimated gas for this transaction (113203666) is higher than gasLimit set in the configuration (0x2710). Please raise the gas limit.
The recipient's can prevent the sender from canceling its stream.
Manual code review
Set a specific gasLimitRecipient that the sender can use, such as:
This way, the sender can perform their functionality without denying the cancellation. Test the complexity to estimate the recipient's needs.
https://www.codehawks.com/contests/clvb9njmy00012dqjyaavpl44
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.