Flow

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

Inadequate access control mechanisms.

Summary

The contract lacks proper checks to ensure that sensitive operations are only performed by authorized parties, potentially allowing unauthorized access and manipulation of stream data.

Vulnerability Details

The withdraw function (lines 417-444) allows any address to withdraw funds from a stream without proper authorization checks:

function withdraw(
uint256 streamId,
address to,
uint128 amount
)
external
override
noDelegateCall
notNull(streamId)
updateMetadata(streamId)
returns (uint128 withdrawnAmount, uint128 protocolFeeAmount)
{
// Checks, Effects, and Interactions: make the withdrawal.
(withdrawnAmount, protocolFeeAmount) = _withdraw(streamId, to, amount);
}

his function only checks if the to address is not zero (line 785) and if the withdrawal amount is not zero (line 780). However, it does not verify if the caller is the stream recipient or has approval to withdraw funds.

Impact

The lack of proper access control in the withdraw function and related internal functions could lead to:

  1. Unauthorized withdrawals: Any address could potentially withdraw funds from any stream, regardless of their relationship to the stream.

  2. Stream manipulation: Malicious actors could modify stream parameters without authorization.

  3. Loss of funds: Stream recipients could lose their funds to unauthorized withdrawals.

Tools Used

manual analysis

Recommendations

Implement proper access control for the withdraw function:

  • Add a check to ensure the caller is either the stream recipient or has approval.

  • Consider implementing a more granular permission system.

Updates

Lead Judging Commences

inallhonesty Lead Judge
10 months ago
inallhonesty Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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