Flow

Sablier
FoundryDeFi
20,000 USDC
View results
Submission Details
Severity: medium
Invalid

Unlimited access to the `SablierFlow::withdraw()` function

Summary

Currently, anyone can withdraw funds to the recipient address, but the recipient may prefer to receive funds at a different address.

Vulnerability Details

There is a possibility that the recipient's address is compromised and the recipient wants to withdraw funds to an external address, but the sender or someone else may transfer the funds to the recipient's to address before this, resulting in the loss of funds.

Impact

User may lose funds.

PoC

SablierFlow::_withdraw():

// Check: `msg.sender` is neither the stream's recipient nor an approved third party, the withdrawal address
// must be the recipient.
if (to != _ownerOf(streamId) && !_isCallerStreamRecipientOrApproved(streamId)) {
revert Errors.SablierFlow_WithdrawalAddressNotRecipient({ streamId: streamId, caller: msg.sender, to: to });

Tools Used

Manual review.

Recommendations

Modify the check in the SablierFlow::_withdraw():

// Check: `msg.sender` is neither the stream's recipient nor an approved third party, the withdrawal address
// must be the recipient.
- if (to != _ownerOf(streamId) && !_isCallerStreamRecipientOrApproved(streamId)) {
+ if (!_isCallerStreamRecipientOrApproved(streamId)) {
revert Errors.SablierFlow_WithdrawalAddressNotRecipient({ streamId: streamId, caller: msg.sender, to: to });
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.