Flow

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

Allowing anyone to call withdraw on behalf of the streamId owner might have consequences

Summary

Anybody can call withdraw for a streamId as long as they specify the receiver of the tokens to be the owner of the streamId
https://github.com/Cyfrin/2024-10-sablier/blob/8a2eac7a916080f2022527408b004578b21c51d0/src/SablierFlow.sol#L792-L794
This could be an issue is the current owner is a contract that doesnt have logic to handle the received tokens

Vulnerability Details

lets take a simple example
a stream is created to payments to a worker, however that worker is only meant to get paid at the end of the month so the company stores their workers streamId in an escrow until the end of the month
To ensure the workers funds are safe, the escrow itself can only transfer the streamId to the expected workers or call withdtaw with the "to" param set as the expected worker

A malicious actor can call withdraw at any point, in the month preferably towards the end to cause maximum loss, to withdraw the tokens to the escrow
As a result this funds wlll be lost forever as the escrow doesnt contain any logic for withdrawing the tokens that are altready in it

Impact
the ERC20 tokens could be lost forever

Tools Used
manual analysis

Recommendations
The withdraw functions should only be called by approved parties or the owner

Updates

Lead Judging Commences

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

Appeal created

silver_eth Submitter
8 months ago
inallhonesty Lead Judge
8 months ago
inallhonesty Lead Judge 8 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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